Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,38 @@ on:
pull_request:
types: [ opened, synchronize, reopened ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install make
run: sudo apt-get install make
- name: Install Hatch
uses: pypa/hatch@install
- name: unit test
run: |
make test
hatch test -py ${{ matrix.python-version }}
- name: lint
run: |
hatch run +py=${{ matrix.python-version }} e2e:lint
- name: e2e test
run: |
hatch env create
. "$(hatch env find)/bin/activate"
hatch env create "e2e.py${{ matrix.python-version }}"
. "$(hatch env find "e2e.py${{ matrix.python-version }}")/bin/activate"
python -V
make ci
- name: lint
run: |
make lint
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Run tests using the 'test' environment defined in pyproject.toml
test:
hatch run test
hatch test

# Build the documentation using the 'docs' environment
docs:
Expand Down
35 changes: 17 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,11 @@ jsonknife = "dictknife.commands.jsonknife:main"
swaggerknife = "dictknife.commands.swaggerknife:main"

[project.optional-dependencies]
testing = [
"ruamel.yaml",
"jsonpatch",
"pytest",
]
lint = ["flake8", "black", "mypy"]
docs = ["sphinx", "recommonmark", "sphinx_rtd_theme"]
load = ["ruamel.yaml", "tomlkit"]
command = ["ruamel.yaml", "magicalimport", "prestring"]
spreadsheet = ["google-api-python-client", "google-auth-oauthlib"]
dev = [
"dictknife[testing]",
"dictknife[lint]",
"dictknife[load]",
"dictknife[command]",
# "dictknife[docs]",
# "dictknife[spreadsheet]",
]

[tool.hatch.version]
path = "src/dictknife/__version__.py"
Expand All @@ -63,10 +50,13 @@ packages = ["src/dictknife"]
[tool.hatch.envs.default]
description = "Default environment for everyday tasks"
dependencies = [
"dictknife[dev]",
"dictknife[lint]",
"dictknife[load]",
"dictknife[command]",
# "dictknife[docs]",
# "dictknife[spreadsheet]",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:src/dictknife/tests}"
lint = "flake8 --show-source --ignore=E501,E121,W503 src/dictknife"
type-check = "mypy --ignore-missing-imports --check-untyped-defs --no-strict-optional src/dictknife"
format = "black src/dictknife"
Expand All @@ -79,12 +69,21 @@ all = [
"test",
]

[tool.hatch.envs.test]
[tool.hatch.envs.hatch-test]
dependencies = [
"dictknife[testing]"
"ruamel.yaml",
"jsonpatch",
"pytest",
]
default-args = ["src/dictknife/tests"]

[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.10", "3.11", "3.12", "3.13"]

# e2e
[tool.hatch.envs.e2e]

[[tool.hatch.envs.test.matrix]]
[[tool.hatch.envs.e2e.matrix]]
python = ["3.10", "3.11", "3.12", "3.13"]

# TODO: remove
Expand Down