diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48290ad1a..cb881d5de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: generate cache key PY - run: echo "::set-env name=PY::$((python -VV; poetry -V) | sha256sum | cut -d' ' + run: echo "::set-env name=PY::$((python -VV; pip freeze) | sha256sum | cut -d' ' -f1)" - uses: actions/cache@v1 with: @@ -31,7 +31,7 @@ jobs: with: path: ~/.local key: local-${{ env.PY }}|${{ hashFiles('pyproject.toml') }}|${{ hashFiles('poetry.lock') }}|${{ hashFiles('.pre-commit-config.yaml') }} - - run: python -m pip install poetry + - run: python -m pip install poetry poetry-dynamic-versioning - run: poetry install - name: Run pre-commit run: | @@ -52,9 +52,9 @@ jobs: uses: actions/setup-python@v1 with: python-version: 3.8 - - run: python -m pip install poetry + - run: python -m pip install poetry poetry-dynamic-versioning - name: generate cache key PY - run: echo "::set-env name=PY::$((python -VV; poetry -V) | sha256sum | cut -d' ' + run: echo "::set-env name=PY::$((python -VV; pip freeze) | sha256sum | cut -d' ' -f1)" - uses: actions/cache@v1 with: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f753e2d77..f0f78226a 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -15,9 +15,9 @@ jobs: uses: actions/setup-python@v1 with: python-version: 3.8 - - run: python -m pip install poetry + - run: python -m pip install poetry poetry-dynamic-versioning - name: generate cache key PY - run: echo "::set-env name=PY::$((python -VV; poetry -V) | sha256sum | cut -d' ' + run: echo "::set-env name=PY::$((python -VV; pip freeze) | sha256sum | cut -d' ' -f1)" - uses: actions/cache@v1 with: diff --git a/copier/__init__.py b/copier/__init__.py index ccd82363a..7a3b6346b 100644 --- a/copier/__init__.py +++ b/copier/__init__.py @@ -2,4 +2,3 @@ """ from .main import * # noqa from .tools import * # noqa -from .version import __version__ # noqa diff --git a/copier/cli.py b/copier/cli.py index 08a45e02f..1f9fda091 100755 --- a/copier/cli.py +++ b/copier/cli.py @@ -7,7 +7,6 @@ from .config.objects import UserMessageError from .main import copy from .types import AnyByStrDict, OptStr -from .version import __version__ def handle_exceptions(method): @@ -38,7 +37,6 @@ class CopierApp(cli.Application): copier [SWITCHES] [update] [destination_path] """ ) - VERSION = __version__ CALL_MAIN_IF_NESTED_COMMAND = False data: AnyByStrDict = {} diff --git a/copier/version.py b/copier/version.py deleted file mode 100644 index 03f00bd90..000000000 --- a/copier/version.py +++ /dev/null @@ -1,7 +0,0 @@ -import pkg_resources - -try: - __version__: str = pkg_resources.require("copier")[0].version -except Exception: # pragma: no cover - # Run pytest without needing to install the library - __version__ = None # type: ignore diff --git a/pyproject.toml b/pyproject.toml index 86c73276a..80f1741b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool] [tool.poetry] name = "copier" -version = "3.0.0-alpha6" +version = "0.0.0" description = "A library for rendering project templates." license = "MIT" classifiers = [ @@ -52,6 +52,11 @@ pre-commit = "*" pytest = "^5.3" pytest-cov = "*" +[tool.poetry-dynamic-versioning] +enable = true +style = "semver" +vcs = "git" + [tool.black] line-length = 88 target-version = ['py36']