diff --git a/.gitignore b/.gitignore index e97386c..274cb4d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ dist/ downloads/ eggs/ .eggs/ +.pdm-python lib/ lib64/ parts/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 85d9580..5883f2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changes - improve prompt for project name +- prepare switch from poetry to pdm ### Deprecated diff --git a/README.md b/README.md index b83ae50..83d5a41 100644 --- a/README.md +++ b/README.md @@ -47,10 +47,12 @@ components of the MEx project are open-sourced under the same license as well. - on unix, consider using pyenv https://github.com/pyenv/pyenv - get pyenv `curl https://pyenv.run | bash` - install 3.11 `pyenv install 3.11` - - use version `pyenv global 3.11` + - switch version `pyenv global 3.11` - run `pip install cruft` -- on windows, see https://python-poetry.org/docs/managing-environments - - install `python3.11` in your preferred way +- on windows, consider using pyenv-win https://pyenv-win.github.io/pyenv-win/ + - follow https://pyenv-win.github.io/pyenv-win/#quick-start + - install 3.11 `pyenv install 3.11` + - switch version `pyenv global 3.11` - run `pip install cruft` ## usage diff --git a/mex-{{ cookiecutter.project_name }}/.dockerignore b/mex-{{ cookiecutter.project_name }}/.dockerignore index 93870dc..2f9109b 100644 --- a/mex-{{ cookiecutter.project_name }}/.dockerignore +++ b/mex-{{ cookiecutter.project_name }}/.dockerignore @@ -121,10 +121,12 @@ dmypy.json .bandit .isort.cfg .mypy.ini +.pdm-python .pre-commit-config.yaml .pydocstyle Makefile mex.bat +pdm.lock poetry.lock poetry.toml pytest.ini diff --git a/mex-{{ cookiecutter.project_name }}/.github/workflows/cve-scan.yml b/mex-{{ cookiecutter.project_name }}/.github/workflows/cve-scan.yml index cc0c03a..585bca3 100644 --- a/mex-{{ cookiecutter.project_name }}/.github/workflows/cve-scan.yml +++ b/mex-{{ cookiecutter.project_name }}/.github/workflows/cve-scan.yml @@ -32,7 +32,7 @@ jobs: cache-name: cache-trivy with: path: ~/.cache/trivy - {% raw %}key: ${{ env.cache-name }}-${{ hashFiles('poetry.lock') }}{% endraw %} + {% raw %}key: ${{ env.cache-name }}-${{ hashFiles('*.lock') }}{% endraw %} restore-keys: | {% raw %}${{ env.cache-name }}-{% endraw %} diff --git a/mex-{{ cookiecutter.project_name }}/.github/workflows/documentation.yml b/mex-{{ cookiecutter.project_name }}/.github/workflows/documentation.yml index db5f1a3..703597a 100644 --- a/mex-{{ cookiecutter.project_name }}/.github/workflows/documentation.yml +++ b/mex-{{ cookiecutter.project_name }}/.github/workflows/documentation.yml @@ -39,13 +39,13 @@ jobs: restore-keys: | {% raw %}${{ env.cache-name }}-{% endraw %} - - name: Cache poetry + - name: Cache environment uses: actions/cache@v4 env: - cache-name: cache-poetry + cache-name: cache-environment with: path: ~/.cache/pip - {% raw %}key: ${{ env.cache-name }}-${{ hashFiles('poetry.lock') }}{% endraw %} + {% raw %}key: ${{ env.cache-name }}-${{ hashFiles('*.lock') }}{% endraw %} restore-keys: | {% raw %}${{ env.cache-name }}-{% endraw %} diff --git a/mex-{{ cookiecutter.project_name }}/.github/workflows/linting.yml b/mex-{{ cookiecutter.project_name }}/.github/workflows/linting.yml index 631650e..bcab021 100644 --- a/mex-{{ cookiecutter.project_name }}/.github/workflows/linting.yml +++ b/mex-{{ cookiecutter.project_name }}/.github/workflows/linting.yml @@ -34,13 +34,13 @@ jobs: restore-keys: | {% raw %}${{ env.cache-name }}-{% endraw %} - - name: Cache poetry + - name: Cache environment uses: actions/cache@v4 env: - cache-name: cache-poetry + cache-name: cache-environment with: path: ~/.cache/pip - {% raw %}key: ${{ env.cache-name }}-${{ hashFiles('poetry.lock') }}{% endraw %} + {% raw %}key: ${{ env.cache-name }}-${{ hashFiles('*.lock') }}{% endraw %} restore-keys: | {% raw %}${{ env.cache-name }}-{% endraw %} diff --git a/mex-{{ cookiecutter.project_name }}/.github/workflows/testing.yml b/mex-{{ cookiecutter.project_name }}/.github/workflows/testing.yml index d0c5fea..240e43f 100644 --- a/mex-{{ cookiecutter.project_name }}/.github/workflows/testing.yml +++ b/mex-{{ cookiecutter.project_name }}/.github/workflows/testing.yml @@ -34,13 +34,13 @@ jobs: restore-keys: | {% raw %}${{ env.cache-name }}-{% endraw %} - - name: Cache poetry + - name: Cache environment uses: actions/cache@v4 env: - cache-name: cache-poetry + cache-name: cache-environment with: path: ~/.cache/pip - {% raw %}key: ${{ env.cache-name }}-${{ hashFiles('poetry.lock') }}{% endraw %} + {% raw %}key: ${{ env.cache-name }}-${{ hashFiles('*.lock') }}{% endraw %} restore-keys: | {% raw %}${{ env.cache-name }}-{% endraw %} diff --git a/mex-{{ cookiecutter.project_name }}/.gitignore b/mex-{{ cookiecutter.project_name }}/.gitignore index 8f4b50c..1a65936 100644 --- a/mex-{{ cookiecutter.project_name }}/.gitignore +++ b/mex-{{ cookiecutter.project_name }}/.gitignore @@ -14,6 +14,7 @@ dist/ downloads/ eggs/ .eggs/ +.pdm-python lib/ lib64/ parts/ diff --git a/mex-{{ cookiecutter.project_name }}/Makefile b/mex-{{ cookiecutter.project_name }}/Makefile index d02ca19..ab1fea9 100644 --- a/mex-{{ cookiecutter.project_name }}/Makefile +++ b/mex-{{ cookiecutter.project_name }}/Makefile @@ -16,7 +16,7 @@ hooks: fi; \ install: setup hooks - # run the poetry installation with embedded virtual environment + # install packages from lock file in local virtual environment @ echo installing package; \ poetry install --no-interaction --sync; \ diff --git a/mex-{{ cookiecutter.project_name }}/README.md b/mex-{{ cookiecutter.project_name }}/README.md index 5cc1c3a..c757f47 100644 --- a/mex-{{ cookiecutter.project_name }}/README.md +++ b/mex-{{ cookiecutter.project_name }}/README.md @@ -50,13 +50,12 @@ components of the MEx project are open-sourced under the same license as well. - on unix, consider using pyenv https://github.com/pyenv/pyenv - get pyenv `curl https://pyenv.run | bash` - install 3.11 `pyenv install 3.11` - - create env `pyenv virtualenv 3.11 mex` - - go to repo root - - use env `pyenv local mex` + - switch version `pyenv global 3.11` - run `make install` -- on windows, see https://python-poetry.org/docs/managing-environments - - install `python3.11` in your preferred way - - go to repo root +- on windows, consider using pyenv-win https://pyenv-win.github.io/pyenv-win/ + - follow https://pyenv-win.github.io/pyenv-win/#quick-start + - install 3.11 `pyenv install 3.11` + - switch version `pyenv global 3.11` - run `.\mex.bat install` ### linting and testing @@ -71,16 +70,16 @@ components of the MEx project are open-sourced under the same license as well. ### updating dependencies - update boilerplate files with `cruft update` -- update global dependencies in `requirements.txt` manually +- update global requirements in `requirements.txt` manually - update git hooks with `pre-commit autoupdate` - show outdated dependencies with `poetry show --outdated` - update dependencies in poetry using `poetry update --lock` -- update github actions manually in `.github/workflows/*.yml` +- update github actions in `.github/workflows/*.yml` manually ### creating release -- update version, eg `poetry version minor` -- commit update `git commit --message "..." pyproject.toml` +- update version in `pyproject.toml` and `CHANGELOG.md` +- commit update `git commit --message "..."` - create a tag `git tag ...` - push `git push --follow-tags` diff --git a/mex-{{ cookiecutter.project_name }}/mex.bat b/mex-{{ cookiecutter.project_name }}/mex.bat index 38380ee..858e7f6 100644 --- a/mex-{{ cookiecutter.project_name }}/mex.bat +++ b/mex-{{ cookiecutter.project_name }}/mex.bat @@ -20,7 +20,7 @@ if "%CI%"=="" ( if %errorlevel% neq 0 exit /b %errorlevel% ) -@REM run the poetry installation with embedded virtual environment +@REM install packages from lock file in local virtual environment echo installing package poetry install --no-interaction --sync exit /b %errorlevel%