diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 0000000..8fb235d --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1,4 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ +ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..00a7b00 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.git_archival.txt export-subst diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8d76ea7..563f3e1 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -13,6 +13,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - uses: hynek/build-and-inspect-python-package@v1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52f7b01..44e16f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - uses: actions/setup-python@v4 with: @@ -65,6 +67,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - uses: hynek/build-and-inspect-python-package@v1 @@ -73,6 +77,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Run repo-review action uses: ./ diff --git a/pyproject.toml b/pyproject.toml index cc2d368..db23324 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["hatchling"] +requires = ["hatchling", "hatch-vcs"] build-backend = "hatchling.build" @@ -8,30 +8,27 @@ name = "repo_review" authors = [ { name = "Henry Schreiner", email = "henryfs@princeton.edu" }, ] -license = { file = "LICENSE" } - description = "Framework that can run checks on repos" readme = "README.md" - requires-python = ">=3.10" - classifiers = [ - "License :: OSI Approved :: BSD License", - "Topic :: Scientific/Engineering", - "Intended Audience :: Science/Research", + "Development Status :: 4 - Beta", "Intended Audience :: Developers", - "Operating System :: OS Independent", + "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", - "Programming Language :: Python", + "Operating System :: OS Independent", + "Environment :: Console", + "Environment :: WebAssembly :: Emscripten", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", - "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Topic :: Software Development :: Quality Assurance", + "Topic :: Software Development :: Libraries :: Python Modules", + "Typing :: Typed", ] - dynamic = ["version"] - dependencies = [ "markdown-it-py", "pyyaml", @@ -70,8 +67,10 @@ repo-review = "repo_review.__main__:main" [project.entry-points."repo_review.fixtures"] pyproject = "repo_review.fixtures:pyproject" + [tool.hatch] -version.path = "src/repo_review/__init__.py" +version.source = "vcs" +build.hooks.vcs.version-file = "src/repo_review/_version.py" [tool.pytest.ini_options] diff --git a/src/repo_review/__init__.py b/src/repo_review/__init__.py index f30dfd6..0d343fd 100644 --- a/src/repo_review/__init__.py +++ b/src/repo_review/__init__.py @@ -7,6 +7,6 @@ from __future__ import annotations -__version__ = "0.7.0b5" +from ._version import version as __version__ __all__ = ["__version__"] diff --git a/src/repo_review/_version.pyi b/src/repo_review/_version.pyi new file mode 100644 index 0000000..91744f9 --- /dev/null +++ b/src/repo_review/_version.pyi @@ -0,0 +1,4 @@ +from __future__ import annotations + +version: str +version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str]