Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use hatch, hatch-vcs; drop setuptools, versioneer. #145

16 changes: 5 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ commands:
steps:
- restore_cache:
keys:
- cache_v7-wayback-<< parameters.python-version >>-{{ arch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}-{{ checksum "requirements-docs.txt" }}
- cache_v7-wayback-<< parameters.python-version >>-{{ arch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}
- cache_v7-wayback-<< parameters.python-version >>-{{ arch }}-{{ checksum "requirements.txt" }}-
- cache_v7-wayback-<< parameters.python-version >>-{{ arch }}-
- cache_v8-wayback-<< parameters.python-version >>-{{ arch }}-{{ checksum "pyproject.toml" }}
- cache_v8-wayback-<< parameters.python-version >>-{{ arch }}-

- run:
name: Install Dependencies
Expand Down Expand Up @@ -56,7 +54,7 @@ commands:
pip install .[docs]

- save_cache:
key: cache_v7-wayback-<< parameters.python-version >>-{{ arch }}-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}-{{ checksum "requirements-docs.txt" }}
key: cache_v8-wayback-<< parameters.python-version >>-{{ arch }}-{{ checksum "pyproject.toml" }}
paths:
- ~/venv

Expand Down Expand Up @@ -116,7 +114,7 @@ jobs:
name: Build Distribution
command: |
. ~/venv/bin/activate
python setup.py sdist bdist_wheel
python -m build .
- run:
name: Check Distribution
command: |
Expand Down Expand Up @@ -150,12 +148,8 @@ workflows:
- test:
matrix:
parameters:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
urllib3-version: ["1.20", "2.0"]
exclude:
# urllib3v2 is not compatible with Python < 3.7.
- python-version: "3.6"
urllib3-version: "2.0"
- lint
- build
- docs
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
wayback/_version.py export-subst
.git_archival.txt export-subst
*.py diff=python
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,6 @@ target/

#Ipython Notebook
.ipynb_checkpoints

# generated by hatch-vcs
wayback/_version.py
36 changes: 12 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ maintainers = [
# Maybe this should be:
# license = {text = "BSD (3-clause)"}
license = {file = "LICENSE"}
requires-python = ">=3.6"
requires-python = ">=3.7"
danielballan marked this conversation as resolved.
Show resolved Hide resolved
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
Expand All @@ -41,10 +41,10 @@ dependencies = [
# itself (>=3.8). This depends on the `test` extra, which _does_ work on the
# same Python versions as the main package source.
dev = [
"wheel",
"build ~=1.0.3",
"check-wheel-contents ~=0.6.0",
"flake8 ~=6.1.0",
"twine",
"twine ~=4.0.2",
"wayback[test]"
]
# For building documentation. These are separated from dev because there are a
Expand All @@ -63,7 +63,6 @@ test = [
"codecov",
"coverage",
"requests-mock",
"setuptools",
"pytest",
"vcrpy",
]
Expand All @@ -76,29 +75,18 @@ test = [
"Issues" = "https://github.com/edgi-govdata-archiving/wayback/issues"

[build-system]
requires = ["setuptools>=61.0", "versioneer[toml]==0.29"]
build-backend = "setuptools.build_meta"
requires = ["hatchling", "hatch-vcs"]
danielballan marked this conversation as resolved.
Show resolved Hide resolved
build-backend = "hatchling.build"

[tool.setuptools.packages.find]
where = ["."]
exclude = ["docs", "tests"]
[tool.hatch]
version.source = "vcs"
build.hooks.vcs.version-file = "wayback/_version.py"

[tool.setuptools.package-data]
wayback = [
# When adding files here, remember to update MANIFEST.in as well, or else
# they will not be included in the distribution on PyPI!
# Details: https://setuptools.pypa.io/en/latest/userguide/datafiles.html
]

[tool.setuptools.dynamic]
version = {attr = "wayback.__version__"}
[tool.hatch.build.targets.sdist]
exclude = [".git_archival.txt"]

[tool.versioneer]
VCS = "git"
style = "pep440-post"
versionfile_source = "wayback/_version.py"
versionfile_build = "wayback/_version.py"
tag_prefix = "v"
[tool.hatch.build.targets.wheel]
exclude = ["wayback/tests/*"]
danielballan marked this conversation as resolved.
Show resolved Hide resolved

[tool.check-wheel-contents]
toplevel = "wayback"
Loading