diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index 4fb59ea..0000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,21 +0,0 @@ -[bumpversion] -current_version = 2.0.1 -commit = False -tag = false -parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))? -serialize = - {major}.{minor}.{patch}.{release}{build} - {major}.{minor}.{patch} - -[bumpversion:part:release] -optional_value = prod -first_value = dev -values = - dev - prod - -[bumpversion:part:build] - -[bumpversion:file:docs/conf.py] - -[bumpversion:file:rimseval/__init__.py] diff --git a/.flake8 b/.flake8 index cab3119..5519b0c 100644 --- a/.flake8 +++ b/.flake8 @@ -1,6 +1,8 @@ [flake8] select = B,B9,BLK,C,D,DAR,E,F,I,S,W +exclude = rimseval/_version.py + # black configuration ignore = E203,E501,W503 max-line-length = 88 diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index b43bd4f..75c873a 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flit + pip install flit flit-scm setuptools-scm - name: Build and publish env: FLIT_USERNAME: '__token__' diff --git a/.gitignore b/.gitignore index cff3ba5..54e12fd 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,6 @@ lib64 .nox .pytest_cache htmlcov + +# flit scm version stuff +rimseval/_version.py diff --git a/.readthedocs.yaml b/.readthedocs.yaml index f2fd320..1773ced 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,9 +7,9 @@ version: 2 # Set the version of Python and other tools you might need build: - os: ubuntu-20.04 + os: ubuntu-22.04 tools: - python: "3.9" + python: "3.11" # Build documentation in the docs/ directory with Sphinx sphinx: @@ -26,4 +26,4 @@ formats: python: install: - method: pip - path: . + path: .[doc] diff --git a/docs/conf.py b/docs/conf.py index 5fcec41..6c627a1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -4,12 +4,13 @@ sys.path.append("../") +from rimseval._version import __version__ as version # noqa E402 + # -- Project information ----------------------------------------------------- project = "RIMSEval" author = "Reto Trappitsch" -copyright = f"2021, {author}" -version = "2.0.1" +copyright = f"2020-2023, {author}" release = version diff --git a/pyproject.toml b/pyproject.toml index b7f27d5..bc3accd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["flit_core >=2,<4"] -build-backend = "flit_core.buildapi" +requires = ["flit_scm"] +build-backend = "flit_scm:buildapi" [tool.flit.metadata] module = "rimseval" @@ -48,3 +48,6 @@ test = [ minversion = "6.0" addopts = "--cov=rimseval -v" testpaths = "tests" + +[tool.setuptools_scm] +write_to = "rimseval/_version.py" diff --git a/rimseval/__init__.py b/rimseval/__init__.py index 1e6244a..ac06045 100644 --- a/rimseval/__init__.py +++ b/rimseval/__init__.py @@ -6,6 +6,7 @@ from . import guis from . import interfacer from . import utilities +from ._version import __version__ from .multi_proc import MultiFileProcessor from .processor import CRDFileProcessor @@ -22,11 +23,9 @@ "interfacer", "MultiFileProcessor", "utilities", + "__version__", ] -# Package information -__version__ = "2.0.1" - __title__ = "rimseval" __description__ = ( "Evaluate resonance ionization mass spectrometry measurements, correct, and " @@ -38,4 +37,4 @@ __author__ = "Reto Trappitsch" __license__ = "MIT" -__copyright__ = "Copyright (c) 2022, Reto Trappitsch" +__copyright__ = "Copyright (c) 2020-2023, Reto Trappitsch"