Skip to content

Commit

Permalink
Add support for use pyproject.toml (#1227)
Browse files Browse the repository at this point in the history
Introducing hatch! A new management tool for Python Packaging that supports the pyproject and includes more goodies to the development process. 

Here's a list that summarize what we changed thanks to hatch and the pyproject file:

- Drop `setup.py`, `pytest.ini`, `Manifest.in`, and `setup.cfg` and use `pyproject.toml`.
- Drop `tox.ini` configuration and use hatch test matrix.
- Drop `Makefile` commands and use hatch scripts.
- Migrate `pytest` and `flake8` configs to the right place.
- Remove `src/wiki/core/version.py` in favor of hatch version management.
- Update the documentation.

This commit will not be possible without the further review, testing, and comments by:

Co-authored-by: Ofek Lev <ofekmeister@gmail.com>
Co-authored-by: Benjamin Balder Bach <benjamin@overtag.dk>
  • Loading branch information
3 people committed Nov 30, 2022
1 parent 2b874cd commit 1b03661
Show file tree
Hide file tree
Showing 18 changed files with 656 additions and 620 deletions.
83 changes: 53 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,78 @@ orbs:
python: circleci/python@0.2.1

jobs:
tox:
hatch:
parameters:
tox_env:
description: "Name of Tox environment to run"
default: "py38"
hatch_env:
description: "Name of Hatch environment to run"
default: "py3.8-dj3.2"
type: string
python_version:
description: "Python version string"
default: "3.8"
type: string
description: "Reusable job for invoking tox"
description: "Reusable job for invoking hatch"
docker:
- image: circleci/python:<<parameters.python_version>>
- image: circleci/python:<<parameters.python_version>>
steps:
- checkout
- run: pip install tox && tox -e <<parameters.tox_env>>
- run: pip install hatch && python -m hatch --env test.<<parameters.hatch_env>> run all
lint:
description: "Simple job for linting the pushed code"
docker:
- image: circleci/python:3.8
steps:
- checkout
- run: pip install hatch && python -m hatch --env test.py3.8-dj4.0 run lint

workflows:
main:
jobs:
- tox:
tox_env: "py37-django22"
- hatch:
hatch_env: "py3.7-dj2.2"
python_version: "3.7"
- tox:
tox_env: "py37-django30"
- hatch:
hatch_env: "py3.7-dj3.0"
python_version: "3.7"
- tox:
tox_env: "py37-django31"
- hatch:
hatch_env: "py3.7-dj3.1"
python_version: "3.7"
- tox:
tox_env: "py37-django32"
- hatch:
hatch_env: "py3.7-dj3.2"
python_version: "3.7"
- tox:
tox_env: "py38-django30"
- hatch:
hatch_env: "py3.8-dj2.2"
python_version: "3.8"
- hatch:
hatch_env: "py3.8-dj3.0"
python_version: "3.8"
- tox:
tox_env: "py38-django31"
- hatch:
hatch_env: "py3.8-dj3.1"
- hatch:
hatch_env: "py3.8-dj3.2"
python_version: "3.8"
- tox:
tox_env: "py38-django32"
- hatch:
hatch_env: "py3.8-dj4.0"
python_version: "3.8"
- tox:
tox_env: "py39-django32"
- hatch:
hatch_env: "py3.9-dj2.2"
python_version: "3.9"
- tox:
tox_env: "py310-django32"
- hatch:
hatch_env: "py3.9-dj3.0"
python_version: "3.9"
- hatch:
hatch_env: "py3.9-dj3.1"
python_version: "3.9"
- hatch:
hatch_env: "py3.9-dj3.2"
python_version: "3.9"
- hatch:
hatch_env: "py3.9-dj4.0"
python_version: "3.9"
- hatch:
hatch_env: "py3.10-dj3.2"
python_version: "3.10"
- tox:
tox_env: "py310-django40"
- hatch:
hatch_env: "py3.10-dj4.0"
python_version: "3.10"
- tox:
tox_env: "lint"
python_version: "3.8"
- lint
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ repos:
rev: '5.0.4' # pick a git hash / tag to point to
hooks:
- id: flake8
args: ["--max-line-length=213", "--extend-ignore=E203", "--max-complexity=10"]
exclude: "^(.*/migrations/|testproject/testproject/settings/)"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
Expand Down
7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

104 changes: 0 additions & 104 deletions Makefile

This file was deleted.

153 changes: 0 additions & 153 deletions docs/Makefile

This file was deleted.

Loading

0 comments on commit 1b03661

Please sign in to comment.