diff --git a/.gitignore b/.gitignore index ba6bafa..494d8ea 100644 --- a/.gitignore +++ b/.gitignore @@ -85,7 +85,7 @@ ipython_config.py # pyenv # For a library or package, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: -# .python-version +.python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. diff --git a/.python-version b/.python-version deleted file mode 100644 index 24ee5b1..0000000 --- a/.python-version +++ /dev/null @@ -1 +0,0 @@ -3.13 diff --git a/CHANGELOG.md b/CHANGELOG.md index b58b848..a361803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## v0.3.0 (2025-07-31) + +### Feat + +- **template**: remove python_version variable from cookiecutter +- **template**: remove version from cookiecutter.json + +### Fix + +- **pyproject**: manage version file with commitizen +- **readme**: usage command urls + ## v0.2.0 (2025-07-31) ### Feat diff --git a/README.md b/README.md index a3a1ef7..5fc0afe 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,13 @@ If you want to keep your project in sync with this template, you can use *cruft*. ```bash -cruft create gh:haztecaso/python-template +cruft create https://github.com/haztecaso/python-template ``` Otherwise you can stick with *cookiecutter*. ```bash -cookiecutter gh:haztecaso/python-template +cookiecutter https://github.com/haztecaso/python-template ``` ## Features diff --git a/cookiecutter.json b/cookiecutter.json index 34382fa..72ea159 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -5,13 +5,6 @@ "project_name": "My cool python project", "project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}", "project_short_description": "Short description", - "version": "0.1.0", - "python_version": [ - "3.13", - "3.12", - "3.11", - "3.10" - ], "use_asyncio": "y", "command_line_interface": [ "click", diff --git a/pyproject.toml b/pyproject.toml index 10dfcc3..a95ec4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cookiecutter-haztecaso-python" -version = "0.2.0" +version = "0.3.0" description = "My personal cookiecutter template for Python" readme = "README.md" requires-python = ">=3.13" diff --git a/uv.lock b/uv.lock index 075a0b8..cf257f4 100644 --- a/uv.lock +++ b/uv.lock @@ -169,7 +169,7 @@ wheels = [ [[package]] name = "cookiecutter-haztecaso-python" -version = "0.2.0" +version = "0.3.0" source = { editable = "." } dependencies = [ { name = "cookiecutter" }, diff --git a/{{cookiecutter.project_slug}}/.github/workflows/test.yml b/{{cookiecutter.project_slug}}/.github/workflows/test.yml index 90baf1d..d6989a6 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/test.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/test.yml @@ -13,6 +13,10 @@ jobs: pytest: name: Run tests runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 @@ -23,10 +27,10 @@ jobs: enable-cache: true cache-dependency-glob: "uv.lock" - - name: "Set up Python" + - name: "Set up Python {% raw -%}${{ matrix.python-version }}{%- endraw %}" uses: actions/setup-python@v5 with: - python-version-file: "pyproject.toml" + python-version: {% raw -%}${{ matrix.python-version }}{%- endraw %} - name: Install the project run: uv sync --all-extras --dev diff --git a/{{cookiecutter.project_slug}}/.gitignore b/{{cookiecutter.project_slug}}/.gitignore index ba6bafa..494d8ea 100644 --- a/{{cookiecutter.project_slug}}/.gitignore +++ b/{{cookiecutter.project_slug}}/.gitignore @@ -85,7 +85,7 @@ ipython_config.py # pyenv # For a library or package, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: -# .python-version +.python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. diff --git a/{{cookiecutter.project_slug}}/.python-version b/{{cookiecutter.project_slug}}/.python-version deleted file mode 100644 index 102fdf4..0000000 --- a/{{cookiecutter.project_slug}}/.python-version +++ /dev/null @@ -1 +0,0 @@ -{{ cookiecutter.python_version }} diff --git a/{{cookiecutter.project_slug}}/flake.nix b/{{cookiecutter.project_slug}}/flake.nix index 67e870d..a372241 100644 --- a/{{cookiecutter.project_slug}}/flake.nix +++ b/{{cookiecutter.project_slug}}/flake.nix @@ -57,7 +57,7 @@ pkgs = nixpkgs.legacyPackages.x86_64-linux; - python = pkgs.python{{ cookiecutter.python_version.replace(".", "") }}; + python = pkgs.python3; pythonSet = (pkgs.callPackage pyproject-nix.build.packages { inherit python; diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index 2487956..2f3bd8f 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -1,9 +1,9 @@ [project] name = "{{ cookiecutter.project_slug }}" -version = "{{ cookiecutter.version }}" +version = "0.1.0" description = "{{ cookiecutter.project_short_description }}" readme = "README.md" -requires-python = ">={{ cookiecutter.python_version }}" +requires-python = ">=3.10" dependencies = [ {%- if cookiecutter.command_line_interface.lower() == "click" %} "click", @@ -78,6 +78,10 @@ version_provider = "uv" tag_format = "v${version}" version_scheme = "semver" update_changelog_on_bump = true +version_files = [ + "pyproject.toml:version", + "src/{{ cookiecutter.project_slug }}/version.py", +] [tool.black] line-length = 88 diff --git a/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/version.py b/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/version.py index 00eb123..b22e825 100644 --- a/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/version.py +++ b/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/version.py @@ -1,7 +1,6 @@ """Utilities to retrieve the information of the program version.""" -# Do not edit the version manually, let `make bump` do it. - +# Do not edit the version manually, let `cz bump` do it. __version__ = "0.1.0"