Skip to content

Commit

Permalink
Migrate from setuptools + setuptools_scm to hatchling + hatch-vcs
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Sep 18, 2022
1 parent a806ede commit 6430eb0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 23 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.x"
cache: pip
cache-dependency-path: pyproject.toml

Expand All @@ -33,7 +33,6 @@ jobs:
- name: Build package
run: |
python setup.py --version
python -m build
twine check --strict dist/*
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ repos:
hooks:
- id: pyproject-fmt

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.10.1
hooks:
- id: validate-pyproject

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 0.5.2
hooks:
Expand Down
25 changes: 9 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[build-system]
build-backend = "setuptools.build_meta"
build-backend = "hatchling.build"
requires = [
"setuptools>=61.2",
"setuptools_scm[toml]>=6.2",
"hatch-vcs",
"hatchling",
]

[project]
Expand Down Expand Up @@ -73,21 +73,14 @@ pypistats = "pypistats.cli:main"
[tool.black]
target_version = ["py37"]

[tool.hatch]
version.source = "vcs"

[tool.hatch.version.raw-options]
local_scheme = "no-local-version"

[tool.isort]
profile = "black"

[tool.pytest.ini_options]
addopts = "--color=yes"

[tool.setuptools]
package-dir = {"" = "src"}
zip-safe = true
license-files = ["LICENSE.txt"]
include-package-data = false

[tool.setuptools.packages.find]
where = ["src"]
namespaces = false

[tool.setuptools_scm]
local_scheme = "no-local-version"
5 changes: 0 additions & 5 deletions setup.py

This file was deleted.

1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ envlist =
lint
pins
py{311, 310, 39, 38, 37}
isolated_build = true

[testenv]
extras =
Expand Down

0 comments on commit 6430eb0

Please sign in to comment.