-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #374 from specklesystems/gergo/uvSetup
gergo/uvSetup
- Loading branch information
Showing
63 changed files
with
1,885 additions
and
2,470 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,15 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
codecov: codecov/codecov@3.3.0 | ||
|
||
# Define the jobs we want to run for this project | ||
jobs: | ||
pre-commit: | ||
parameters: | ||
config_file: | ||
default: ./.pre-commit-config.yaml | ||
description: Optional, path to pre-commit config file. | ||
type: string | ||
cache_prefix: | ||
default: '' | ||
description: | | ||
Optional cache prefix to be used on CircleCI. Can be used for cache busting or to ensure multiple jobs use different caches. | ||
type: string | ||
docker: | ||
- image: speckle/pre-commit-runner:latest | ||
resource_class: medium | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- cache-pre-commit-<<parameters.cache_prefix>>-{{ checksum "<<parameters.config_file>>" }} | ||
- run: | ||
name: Install pre-commit hooks | ||
command: pre-commit install-hooks --config <<parameters.config_file>> | ||
- save_cache: | ||
key: cache-pre-commit-<<parameters.cache_prefix>>-{{ checksum "<<parameters.config_file>>" }} | ||
paths: | ||
- ~/.cache/pre-commit | ||
- run: | ||
name: Run pre-commit | ||
command: pre-commit run --all-files | ||
- run: | ||
command: git --no-pager diff | ||
name: git diff | ||
when: on_fail | ||
|
||
test: | ||
machine: | ||
image: ubuntu-2204:2023.02.1 | ||
docker_layer_caching: false | ||
resource_class: medium | ||
parameters: | ||
tag: | ||
default: "3.11" | ||
type: string | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install python | ||
command: | | ||
pyenv install -s << parameters.tag >> | ||
pyenv global << parameters.tag >> | ||
- run: | ||
name: Startup the Speckle Server | ||
command: docker compose -f docker-compose.yml up -d | ||
- run: | ||
name: Install Poetry | ||
command: | | ||
pip install poetry | ||
- run: | ||
name: Install packages | ||
command: poetry install | ||
- run: | ||
name: Run tests | ||
command: poetry run pytest --cov --cov-report xml:reports/coverage.xml --junitxml=reports/test-results.xml | ||
- store_test_results: | ||
path: reports | ||
- store_artifacts: | ||
path: reports | ||
- codecov/upload | ||
|
||
deploy: | ||
build: | ||
docker: | ||
- image: "cimg/python:3.8" | ||
- image: cimg/base:2023.03 | ||
steps: | ||
- checkout | ||
- run: python patch_version.py $CIRCLE_TAG | ||
- run: poetry build | ||
- run: poetry publish -u __token__ -p $PYPI_TOKEN | ||
- run: echo "so long and thanks for all the fish" | ||
|
||
# Orchestrate our job run sequence | ||
workflows: | ||
main: | ||
build_and_test: | ||
jobs: | ||
- pre-commit: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- test: | ||
matrix: | ||
parameters: | ||
tag: ["3.11"] | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- deploy: | ||
context: pypi | ||
requires: | ||
- pre-commit | ||
- test | ||
filters: | ||
tags: | ||
only: /[0-9]+(\.[0-9]+)*/ | ||
branches: | ||
ignore: /.*/ # For testing only! /ci\/.*/ | ||
- build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: "Specklepy test and build" | ||
on: | ||
# pull_request: | ||
# branches: | ||
# - 'v3-dev' | ||
push: | ||
branches: | ||
- "gergo/uvSetup" | ||
jobs: | ||
ci: | ||
name: continuous-integration | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
- "3.13" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install uv and set the python version | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
enable-cache: true | ||
cache-dependency-glob: "uv.lock" | ||
|
||
- name: Install the project | ||
run: uv sync --all-extras --dev | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pre-commit/ | ||
key: ${{ hashFiles('.pre-commit-config.yaml') }} | ||
|
||
- name: Run pre-commit | ||
run: uv run pre-commit run --all-files | ||
|
||
# - name: Run Speckle Server | ||
# run: docker compose up -d | ||
|
||
# - name: Run tests | ||
# run: uv run pytest --cov --cov-report xml:reports/coverage.xml --junitxml=reports/test-results.xml | ||
|
||
# - uses: codecov/codecov-action@v5 | ||
# if: matrix.python-version == 3.13 | ||
# with: | ||
# fail_ci_if_error: true # optional (default = false) | ||
# files: ./reports/test-results.xml # optional | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Minimize uv cache | ||
run: uv cache prune --ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Publish a release to PyPI. | ||
# name: 'Publish to PyPI' | ||
|
||
# on: | ||
# push: | ||
# branches: | ||
# - 'gergo/uvSetup' | ||
|
||
# jobs: | ||
# pypi-publish: | ||
# name: Upload to PyPI | ||
# runs-on: ubuntu-latest | ||
# environment: | ||
# name: release | ||
# permissions: | ||
# # For PyPI's trusted publishing. | ||
# id-token: write | ||
# steps: | ||
# - name: 'Install uv' | ||
# uses: astral-sh/setup-uv@v5 | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# # This is necessary so that we have the tags. | ||
# fetch-depth: 0 | ||
# - uses: mtkennerly/dunamai-action@v1 | ||
# with: | ||
# env-var: MY_VERSION | ||
# args: --style semver | ||
# - run: echo $MY_VERSION | ||
# - name: 'Build artifacts' | ||
# run: uv build | ||
# - name: Publish to PyPi | ||
# run: uv publish --publish-url https://test.pypi.org/simple/ | ||
|
||
# - name: Test package install | ||
# run: uv run --with specklepy --no-project -- python -c "import specklepy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,31 @@ | ||
repos: | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
- repo: local | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
rev: v0.8.2 | ||
name: ruff lint | ||
entry: uv run ruff check --force-exclude | ||
language: system | ||
types_or: [python, pyi] | ||
# Run the formatter. | ||
- id: ruff-format | ||
name: ruff format | ||
entry: uv run ruff format --force-exclude | ||
language: system | ||
types_or: [python, pyi] | ||
|
||
|
||
- repo: https://github.com/commitizen-tools/commitizen | ||
hooks: | ||
- id: commitizen | ||
- id: commitizen-branch | ||
stages: | ||
- push | ||
- pre-push | ||
rev: v3.13.0 | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 24.10.0 | ||
hooks: | ||
- id: black | ||
# It is recommended to specify the latest version of Python | ||
# supported by your project here, or alternatively use | ||
# pre-commit's default_language_version, see | ||
# https://pre-commit.com/#top_level-default_language_version | ||
# language_version: python3.11 | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
rev: v5.0.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.