diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml new file mode 100644 index 0000000..fb36cd4 --- /dev/null +++ b/.github/workflows/github-action.yml @@ -0,0 +1,35 @@ +name: 'Specklepy test and build' +on: + pull_request: + branches: + - 'v3-dev' + push: + branches: + - 'gergo/uvSetup' +jobs: + build: + name: continuous-integration + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - '3.10' + - '3.11' + - '3.12' + + 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 + + # do some more stuff here + - name: Minimize uv cache + run: uv cache prune --ci diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3767196..e4c0fed 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,13 +4,15 @@ repos: # Run the linter. - id: ruff name: ruff lint - entry: uv run ruff check + 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 + entry: uv run ruff format --force-exclude language: system + types_or: [python, pyi] - repo: https://github.com/commitizen-tools/commitizen diff --git a/pyproject.toml b/pyproject.toml index 022e996..75cf1ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,10 @@ name = "specklepy" description = "The Python SDK for Speckle 2.0" readme = "README.md" authors = [{ name = "Speckle Systems", email = "devops@speckle.systems" }] -# license = "" +# packages = [ +# { include = "specklepy", from = "src" }, +# { include = "speckle_automate", from = "src" }, +# ] license = { text = "Apache-2.0" } requires-python = ">=3.10.0, <4.0" dependencies = [ @@ -21,78 +24,33 @@ dependencies = [ "ujson>=5.10.0", ] +[dependency-groups] +dev = [ + "commitizen>=4.1.0", + "devtools>=0.12.2", + "pre-commit>=4.0.1", + "pytest>=8.3.4", + "pytest-asyncio>=0.25.2", + "pytest-cov>=6.0.0", + "pytest-ordering>=0.6", + "types-deprecated>=1.2.15.20241117", + "types-requests>=2.32.0.20241016", + "types-ujson>=5.10.0.20240515", +] + [project.urls] repository = "https://github.com/specklesystems/specklepy" documentation = "https://speckle.guide/dev/py-examples.html" homepage = "https://speckle.systems/" -# packages = [ -# { include = "specklepy", from = "src" }, -# { include = "speckle_automate", from = "src" }, -# ] -# [build-system] - - -# [tool.poetry.dependencies] -# [project.dependencies] -# pydantic = "^2.5" -# appdirs = "^1.4.4" -# gql = { extras = ["requests", "websockets"], version = "^3.3.0" } -# ujson = "^5.3.0" -# Deprecated = "^1.2.13" -# stringcase = "^1.2.0" -# attrs = "^23.1.0" -# httpx = "^0.25.0" -# pydantic-settings = "^2.6.1" - -# [tool.poetry.group.dev.dependencies] -# black = "24.10.0" -# isort = "^5.13.2" -# pylint = "^3.3.2" -# mypy = "^0.982" -# ruff = "^0.8.2" - -# pytest = "^7.1.3" -# pytest-asyncio = "^0.23.0" -# pytest-ordering = "^0.6" -# pytest-cov = "^3.0.0" -# devtools = "^0.8.0" -# pre-commit = "^2.20.0" -# commitizen = "^3.13.0" -# types-deprecated = "^1.2.9" -# types-ujson = "^5.6.0.0" -# types-requests = "^2.28.11.5" - -[tool.black] -exclude = ''' -/( - \.eggs - | \.git - | \.hg - | \.mypy_cache - | \.tox - | \.venv - | _build - | buck-out - | build - | dist -)/ -''' -include = '\.pyi?$' -line-length = 88 -target-version = ["py39", "py310", "py311", "py312", "py313"] [tool.commitizen] name = "cz_conventional_commits" version = "2.9.2" tag_format = "$version" -# [build-system] -# requires = ["poetry-core>=1.0.0"] -# build-backend = "poetry.core.masonry.api" - -# [tool.isort] -# profile = "black" +[tool.ruff] +exclude = [".venv", "**/*.yml"] [tool.ruff.lint] select = [ @@ -110,17 +68,3 @@ select = [ "I", ] ignore = ["UP006", "UP007", "UP035"] - -[dependency-groups] -dev = [ - "commitizen>=4.1.0", - "devtools>=0.12.2", - "pre-commit>=4.0.1", - "pytest>=8.3.4", - "pytest-asyncio>=0.25.2", - "pytest-cov>=6.0.0", - "pytest-ordering>=0.6", - "types-deprecated>=1.2.15.20241117", - "types-requests>=2.32.0.20241016", - "types-ujson>=5.10.0.20240515", -]