Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
ad4659e
Updates some github workflows using values from pytest-static.
56kyle Mar 16, 2024
efe99bb
Adds basic folder structure for test architecture.
56kyle Mar 16, 2024
3f6df6d
Moves test_main.py into unit tests section.
56kyle Mar 16, 2024
f13e114
Adds docstrings to the new file structure.
56kyle Mar 16, 2024
38e8fb8
Merge pull request #1 from 56kyle/add-test-architecture
56kyle Mar 17, 2024
6ece39f
Merge pull request #2 from 56kyle/github-actions
56kyle Mar 17, 2024
cf44b23
Changes test matrix in github actions to match 3.9-3.12.
56kyle Mar 17, 2024
bc27ea3
Updates all references to versions of Python aside from in the poetry…
56kyle Mar 17, 2024
6fc921a
Merge branch 'develop' into update-python-versions
56kyle Mar 17, 2024
ee1ceb4
Fixes broken anchor in link.
56kyle Mar 17, 2024
9e7b463
Replaces gitlab link with github repo due to gitlab signin breaking l…
56kyle Mar 17, 2024
120f90e
Updates poetry install recommendation to use pipx as recommended by t…
56kyle Mar 17, 2024
5963d09
Removes now obsolete install-poetry.py link.
56kyle Mar 17, 2024
373ce9a
Updates poetry install recomendation to use pipx and removes link to …
56kyle Mar 17, 2024
e35fb15
Merge remote-tracking branch 'origin/update-python-versions' into upd…
56kyle Mar 17, 2024
118b9d1
Adds some escapes for portions that shouldn't evaluate in cookiecutte…
56kyle Mar 17, 2024
85917b6
Adds another escaped portion to release.yml.
56kyle Mar 17, 2024
472204e
Adds one more escaped portion to release.yml.
56kyle Mar 17, 2024
c2d0885
Tries to undo somer of the faulty changes done to the github actions …
56kyle Mar 17, 2024
4e4cb71
Removes line breaking pre-commit in ci/cd.
56kyle Mar 17, 2024
ff573bc
Runs poetry update in a generated project and updates poetry.lock.
56kyle Mar 17, 2024
4296565
Updates ci/cd constraints in main project to match the generated one'…
56kyle Mar 17, 2024
797148b
Adds some blank lines that error in the 3.12 pre-commit only.
56kyle Mar 17, 2024
1ddb7df
Merge pull request #3 from 56kyle/update-python-versions
56kyle Mar 17, 2024
b7cf3fb
Adds pre file ignores for tests folder.
56kyle Mar 19, 2024
17e57d5
Setting up some new CI/CD.
56kyle Jun 1, 2024
8c94447
Adds first time setup.
56kyle Jun 1, 2024
3244cba
Adds .idea folder.
56kyle Jun 1, 2024
6f0cd69
Adds .idea to .gitignore.
56kyle Jun 1, 2024
c6282b3
Expands the first time setup script to handle the first release.
56kyle Jun 1, 2024
bb82a4f
Fixes poetry version bump command to be the correct command and to be…
56kyle Jun 1, 2024
240b1a5
Removes included .idea since it doesn't work as intended.
56kyle Jun 2, 2024
def0571
Updates first time setup to create a poetry env.
56kyle Jun 2, 2024
65d063f
Removes environment from release.yml for the time being.
56kyle Jun 2, 2024
d8cef12
Replaces some pycharm generated commands with more generic git CLI us…
56kyle Jun 2, 2024
748c3c5
Adds a call to poetry shell prior to poetry install.
56kyle Jun 2, 2024
accf4c0
Updates problematic version reference in github release action.
56kyle Jun 2, 2024
cf0e1c0
Adds beginning portions for demo generation via nox/CLI.
56kyle Jun 2, 2024
b963acd
Fixes github actions to reference the constraints.txt file based off …
56kyle Jun 2, 2024
ab65fd4
Splits apart the portion of first_time_setup.bat that is done in a po…
56kyle Jun 2, 2024
0cb3dd9
Adds loguru and platformdirs as dependencies.
56kyle Jun 3, 2024
86ecc62
Increases flake8 max-line-length from 80 to 120.
56kyle Jun 3, 2024
4c2a2e4
Fixes github actions constraints references that are generated.
56kyle Jun 3, 2024
bb38517
Adds a safety policy by default.
56kyle Oct 9, 2024
6a5b503
Adds `include-hidden-files: true` to tests.yml so that coverage actua…
56kyle Oct 26, 2024
be20db1
feat(nox): add tooling that enables demo generation and syncing
Apr 19, 2025
c6687a8
Merge pull request #1 from koliver-kv/feature/finish-noxfile-sessions…
koliver-kv Apr 19, 2025
7b5d326
fix(noxfile): fix missing code not added into new demo generation and…
Apr 19, 2025
d8ba739
refactor: move coverage and mypy configurations into individual confi…
Apr 19, 2025
9ea8541
fix: remove coverage and mypy configs accidentally left inside pyproj…
Apr 19, 2025
65f1531
feat: add ruff implementations
Apr 19, 2025
4b576f1
fix(cicd): fix several issues surrounding github actions having chang…
Apr 19, 2025
95c374b
Merge pull request #2 from koliver-kv/feature/ruff-implementation
koliver-kv Apr 19, 2025
359defa
fix(cicd): ensure all actions use upload-artifact@v4 and download-art…
Apr 19, 2025
c4c1f74
chore(dependencies): remove old flake8 and bandit dependencies
Apr 19, 2025
ca0fe54
fix(cicd): add missing escaping to github action definition
Apr 19, 2025
2469f4c
chore(noxfile): replace safety check with safety scan due to future d…
Apr 19, 2025
1f82fea
chore(noxfile): remove no longer needed installation of bandit
Apr 19, 2025
878c28e
chore: remove usages and dependencies for pyupgrade due to ruff bundl…
Apr 19, 2025
bf906d0
chore(noxfile): replace coverage[toml] installation with coverage
Apr 19, 2025
b54d77a
chore(dependencies): replace safety with pip-audit due to ridiculous …
Apr 19, 2025
db017c7
chore: remove remaining coverage[toml] references in favor of coverage
Apr 19, 2025
c4d40a3
fix: fix .coveragerc syntax
Apr 19, 2025
f5312a0
chore(config): add a coverage exclusion for if TYPE_CHECKING blocks
Apr 19, 2025
c821b91
fix(cicd): move from merging artifacts to downloading based on path g…
Apr 19, 2025
06996ce
chore: add str wrapper to satisfy mypy
Apr 19, 2025
0093932
chore: add future annotation import to noxfile
Apr 19, 2025
d2b0307
chore(docs): replace python PEP links with direct url instead of redi…
Apr 19, 2025
643309a
chore(cicd): remove bandit step from pre-commit-config.yaml due to au…
Apr 19, 2025
1b57dac
chore(docs): add exclusion to allow proper sphinx config
Apr 19, 2025
a5b3f9c
chore(cicd): update python version used to build docs
Apr 19, 2025
ef1c06c
chore: remove unused import from tools
Apr 19, 2025
47d6d78
chore: replace single quotes with double quotes in tests.yml setting
Apr 19, 2025
2a52f25
chore: change line in noxfile to not be broken apart
Apr 19, 2025
19c2e17
chore: change line in noxfile to be one line instead of multiple
Apr 19, 2025
d9ae1e5
refactor: add parentheses requested by ruff for noxfile logic
Apr 19, 2025
7fccc2d
chore: run ruff format on noxfile
56kyle Apr 19, 2025
c0eda70
Revert "chore: run ruff format on noxfile"
56kyle Apr 19, 2025
6465aab
refactor: run ruff format on noxfile
Apr 19, 2025
f11025c
refactor: run ruff format on the tools folder
Apr 19, 2025
80b32b8
refactor: run ruff format on the noxfile
Apr 19, 2025
ca853ae
chore: remove black from pre-commit-config.yaml and dependencies
Apr 19, 2025
7dd6d70
Merge pull request #4 from koliver-kv/develop
56kyle Apr 19, 2025
f1b0dff
chore: run poetry lock so that GHSA-vqfr-h8mv-ghfj is resolved due to…
56kyle May 8, 2025
47af394
feat: add 3.13 to the supported versions
56kyle May 9, 2025
9a23119
fix: add gnu bash to linkcheck ignore due to incorrect linkcheck resu…
56kyle May 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pip==23.0.1
pip==23.2.1
cookiecutter==2.1.1
cutty==0.18.0
nox==2022.11.21
nox-poetry==1.0.2
poetry==1.3.2
poetry==1.6.1
pre-commit==3.1.0
virtualenv==20.14.1
virtualenv==20.25.0
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
python-version: "3.8"
python-version: "3.9"
- run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip install --constraint=.github/workflows/constraints.txt nox
- name: Build documentation
run: nox --force-color --session=docs
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: docs
path: docs/_build
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ jobs:
fail-fast: false
matrix:
include:
- { python-version: "3.13", os: ubuntu-latest }
- { python-version: "3.13", os: windows-latest }
- { python-version: "3.13", os: macos-latest }
- { python-version: "3.12", os: ubuntu-latest }
- { python-version: "3.11", os: ubuntu-latest }
- { python-version: "3.10", os: ubuntu-latest }
- { python-version: "3.10", os: windows-latest }
- { python-version: "3.10", os: macos-latest }
- { python-version: "3.9", os: ubuntu-latest }
- { python-version: "3.8", os: ubuntu-latest }
- { python-version: "3.7", os: ubuntu-latest }
name: Python ${{ matrix.python-version }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
repository: "cjolowicz/${{ env.PROJECT }}"
path: ${{ env.PROJECT }}
token: ${{ secrets.X_GITHUB_TOKEN }}
- name: Set up Python 3.10
- name: Set up Python 3.13
uses: actions/[email protected]
with:
python-version: "3.10"
python-version: "3.13"
- name: Install cutty
working-directory: ${{ env.TEMPLATE }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Request features on the [Issue Tracker].

## How to set up your development environment

You need Python 3.7+ and the following tools:
You need Python 3.9+ and the following tools:

- [Cookiecutter]
- [Poetry]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ cookiecutter gh:cjolowicz/cookiecutter-hypermodern-python --checkout=2022.6.3
- Generate command-line reference with [sphinx-click]
- Manage project labels with [GitHub Labeler]

The template supports Python 3.7, 3.8, 3.9, and 3.10.
The template supports Python 3.9, 3.10, 3.11, 3.12, and 3.13.

[autodoc]: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
[bandit]: https://github.com/PyCQA/bandit
Expand Down
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Sphinx configuration."""

from datetime import datetime


project = "Hypermodern Python Cookiecutter"
author = "Claudio Jolowicz"
copyright = f"{datetime.now().year}, {author}"
copyright = f"{datetime.now().year}, {author}" # noqa: A001
extensions = ["sphinx.ext.intersphinx", "myst_parser"]
intersphinx_mapping = {"mypy": ("https://mypy.readthedocs.io/en/stable/", None)}
language = "en"
Expand All @@ -21,6 +22,7 @@
"https://github.com/cjolowicz/cookiecutter-hypermodern-python/releases/tag/",
"https://cookiecutter-hypermodern-python.readthedocs.io",
"https://badgen.net/badge/status/alpha/d8624d",
"https://www.gnu.org/software/bash/"
]
myst_enable_extensions = [
"colon_fence",
Expand Down
94 changes: 45 additions & 49 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ python -VV
py -VV
```

Both of these commands should display the latest Python version, 3.10.
Both of these commands should display the latest Python version, 3.13.

For local testing with multiple Python versions,
repeat these steps for the latest bugfix releases of Python 3.7+,
repeat these steps for the latest bugfix releases of Python 3.9+,
with the following changes:

- Do _not_ enable the option to add Python to the `PATH` environment variable.
- `py -VV` and `python -VV` should still display the version of the latest stable release.
- `py -X.Y -VV` (e.g. `py -3.7 -VV`) should display the exact version you just installed.
- `py -X.Y -VV` (e.g. `py -3.9 -VV`) should display the exact version you just installed.

Note that binary installers are not provided for security releases.

Expand Down Expand Up @@ -137,26 +137,27 @@ Install the Python build dependencies for your platform,
using one of the commands listed in the [official instructions][pyenv wiki].

Install the latest point release of every supported Python version.
This project template supports Python 3.7, 3.8, 3.9, and 3.10.
This project template supports Python 3.9, 3.10, 3.11, 3.12, and 3.13.

```console
$ pyenv install 3.7.12
$ pyenv install 3.8.12
$ pyenv install 3.9.10
$ pyenv install 3.10.2
$ pyenv install 3.9.13
$ pyenv install 3.10.11
$ pyenv install 3.11.8
$ pyenv install 3.12.10
$ pyenv install 3.13.3
```

After creating your project (see [below](creating-a-project)),
you can make these Python versions accessible in the project directory,
using the following command:

```console
$ pyenv local 3.10.2 3.9.10 3.8.12 3.7.12
$ pyenv local 3.13.3 3.12.10 3.11.8 3.10.11 3.9.13
```

The first version listed is the one used when you type plain `python`.
Every version can be used by invoking `python<major.minor>`.
For example, use `python3.7` to invoke Python 3.7.
For example, use `python3.9` to invoke Python 3.9.

### Requirements

Expand All @@ -182,15 +183,10 @@ Install [Cookiecutter] using pipx:
$ pipx install cookiecutter
```

Install [Poetry] by downloading and running [install-poetry.py]:

```console
$ python install-poetry.py
```

Install [Nox] and [nox-poetry] using pipx:
Install [Poetry], [Nox], and [nox-poetry] using pipx:

```console
$ pipx install poetry
$ pipx install nox
$ pipx inject nox nox-poetry
```
Expand Down Expand Up @@ -981,14 +977,15 @@ for every Python version supported by your project,
and easily switch between them:

```console
$ poetry env use 3.7
$ poetry env use 3.8
$ poetry env use 3.9
$ poetry env use 3.10
$ poetry env use 3.11
$ poetry env use 3.12
$ poetry env use 3.13
```

Only one Poetry environment can be active at any time.
Note that `3.10` comes last,
Note that `3.13` comes last,
to ensure that the current Python release is the active environment.
Install your package with `poetry install` into each environment after creating it.

Expand Down Expand Up @@ -1161,7 +1158,7 @@ For example, the following may be more practical during development
(this will only run tests and type checks, on the current Python release):

```console
$ nox -p 3.10 -rs tests mypy
$ nox -p 3.13 -rs tests mypy
```

Many sessions accept additional options after `--` separator.
Expand All @@ -1187,39 +1184,39 @@ The following table gives an overview of the available Nox sessions:
- Default
- - [coverage](the-coverage-session)
- Report coverage with [Coverage.py]
- `3.10`
- `3.13`
- (✓)
- - [docs](the-docs-session)
- Build and serve [Sphinx] documentation
- `3.10`
- `3.13`
-
- - [docs-build](the-docs-build-session)
- Build [Sphinx] documentation
- `3.10`
- `3.13`
- ✓
- - [mypy](the-mypy-session)
- Type-check with [mypy]
- `3.7` … `3.10`
- `3.9` … `3.13`
- ✓
- - [pre-commit](the-pre-commit-session)
- Lint with [pre-commit]
- `3.10`
- `3.13`
- ✓
- - [safety](the-safety-session)
- Scan dependencies with [Safety]
- `3.10`
- `3.13`
- ✓
- - [tests](the-tests-session)
- Run tests with [pytest]
- `3.7` … `3.10`
- `3.9` … `3.13`
- ✓
- - [typeguard](the-typeguard-session)
- Type-check with [Typeguard]
- `3.10`
- `3.13`
- ✓
- - [xdoctest](the-xdoctest-session)
- Run examples with [xdoctest]
- `3.7` … `3.10`
- `3.9` … `3.13`
- ✓

:::
Expand Down Expand Up @@ -1279,7 +1276,7 @@ For example, the following command runs mypy
using the current stable release of Python:

```console
$ nox --session=mypy --python=3.10
$ nox --session=mypy --python=3.13
```

Use the separator `--` to pass additional options and arguments to `mypy`.
Expand Down Expand Up @@ -1353,7 +1350,7 @@ For example, the following command runs the test suite
using the current stable release of Python:

```console
$ nox --session=tests --python=3.10
$ nox --session=tests --python=3.13
```

Use the separator `--` to pass additional options to `pytest`.
Expand Down Expand Up @@ -1480,7 +1477,7 @@ For example, the following command runs the examples
using the current stable release of Python:

```console
$ nox --session=xdoctest --python=3.10
$ nox --session=xdoctest --python=3.13
```

By default, the Nox session uses the `all` subcommand to run all examples.
Expand Down Expand Up @@ -2274,28 +2271,28 @@ as shown in the table below:
- Python versions
- - [pre-commit](the-pre-commit-session)
- Ubuntu
- 3.10
- 3.13
- - [safety](the-safety-session)
- Ubuntu
- 3.10
- 3.13
- - [mypy](the-mypy-session)
- Ubuntu
- 3.10, 3.9, 3.8, 3.7
- 3.13, 3.12, 3.11, 3.10, 3.9
- - [tests](the-tests-session)
- Ubuntu
- 3.10, 3.9, 3.8, 3.7
- 3.13, 3.12, 3.11, 3.10, 3.9
- - [tests](the-tests-session)
- Windows
- 3.10
- 3.13
- - [tests](the-tests-session)
- macOS
- 3.10
- 3.13
- - [coverage](the-coverage-session)
- Ubuntu
- 3.10
- 3.13
- - [docs-build](the-docs-build-session)
- Ubuntu
- 3.10
- 3.13

:::

Expand Down Expand Up @@ -2625,7 +2622,7 @@ You can also read the articles on [this blog][hypermodern python blog].
[flake8-bandit]: https://github.com/tylerwince/flake8-bandit
[flake8-bugbear codes]: https://github.com/PyCQA/flake8-bugbear#list-of-warnings
[flake8-bugbear]: https://github.com/PyCQA/flake8-bugbear
[flake8-docstrings]: https://gitlab.com/pycqa/flake8-docstrings
[flake8-docstrings]: https://github.com/pycqa/flake8-docstrings
[flake8-rst-docstrings codes]: https://github.com/peterjc/flake8-rst-docstrings#flake8-validation-codes
[flake8-rst-docstrings]: https://github.com/peterjc/flake8-rst-docstrings
[flake8]: http://flake8.pycqa.org
Expand Down Expand Up @@ -2653,7 +2650,6 @@ You can also read the articles on [this blog][hypermodern python blog].
[hypermodern python cookiecutter]: https://github.com/cjolowicz/cookiecutter-hypermodern-python
[hypermodern python]: https://medium.com/@cjolowicz/hypermodern-python-d44485d9d769
[import hook]: https://docs.python.org/3/reference/import.html#import-hooks
[install-poetry.py]: https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py
[isort black profile]: https://pycqa.github.io/isort/docs/configuration/black_compatibility.html
[isort force_single_line]: https://pycqa.github.io/isort/docs/configuration/options.html#force-single-line
[isort lines_after_imports]: https://pycqa.github.io/isort/docs/configuration/options.html#lines-after-imports
Expand All @@ -2672,10 +2668,10 @@ You can also read the articles on [this blog][hypermodern python blog].
[nox]: https://nox.thea.codes/
[package metadata]: https://packaging.python.org/en/latest/specifications/core-metadata/
[pep 257]: http://www.python.org/dev/peps/pep-0257/
[pep 440]: https://www.python.org/dev/peps/pep-0440/
[pep 517]: https://www.python.org/dev/peps/pep-0517/
[pep 518]: https://www.python.org/dev/peps/pep-0518/
[pep 561]: https://www.python.org/dev/peps/pep-0561/
[pep 440]: https://peps.python.org/pep-0440/
[pep 517]: https://peps.python.org/pep-0517/
[pep 518]: https://peps.python.org/pep-0518/
[pep 561]: https://peps.python.org/pep-0561/
[pep 8]: http://www.python.org/dev/peps/pep-0008/
[pep8-naming codes]: https://github.com/pycqa/pep8-naming#pep-8-naming-conventions
[pep8-naming]: https://github.com/pycqa/pep8-naming
Expand Down Expand Up @@ -2711,7 +2707,7 @@ You can also read the articles on [this blog][hypermodern python blog].
[pypa/gh-action-pypi-publish]: https://github.com/pypa/gh-action-pypi-publish
[pypi]: https://pypi.org/
[pyproject.toml]: https://python-poetry.org/docs/pyproject/
[pytest layout]: https://docs.pytest.org/en/latest/explanation/goodpractices.html#choosing-a-test-layout-import-rules
[pytest layout]: https://docs.pytest.org/en/latest/explanation/goodpractices.html#choosing-a-test-layout
[pytest]: https://docs.pytest.org/en/latest/
[python build]: https://python-poetry.org/docs/cli/#build
[python package]: https://docs.python.org/3/tutorial/modules.html#packages
Expand Down Expand Up @@ -2746,6 +2742,6 @@ You can also read the articles on [this blog][hypermodern python blog].
[versions and constraints]: https://python-poetry.org/docs/dependency-specification/
[virtual environment]: https://docs.python.org/3/tutorial/venv.html
[virtualenv]: https://virtualenv.pypa.io/
[wheel]: https://www.python.org/dev/peps/pep-0427/
[wheel]: https://peps.python.org/pep-0427/
[xdoctest]: https://github.com/Erotemic/xdoctest
[yaml]: https://yaml.org/
12 changes: 3 additions & 9 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,17 @@ Install [Cookiecutter]:
$ pipx install cookiecutter
```

Install [Poetry] by downloading and running [install-poetry.py]:

```console
$ python install-poetry.py
```

Install [Nox] and [nox-poetry]:
Install [Poetry], [Nox], and [nox-poetry]:

```console
$ pipx install poetry
$ pipx install nox
$ pipx inject nox nox-poetry
```

[pipx] is preferred, but you can also install with `pip install --user`.

It is recommended to set up Python 3.7, 3.8, 3.9, 3.10 using [pyenv].
It is recommended to set up Python 3.9, 3.10, 3.11, 3.12, and 3.13 using [pyenv].

## Creating a project

Expand Down Expand Up @@ -159,7 +154,6 @@ by applying labels to them, like this:
[codecov]: https://codecov.io/
[cookiecutter]: https://github.com/audreyr/cookiecutter
[github]: https://github.com/
[install-poetry.py]: https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py
[nox]: https://nox.thea.codes/
[nox-poetry]: https://nox-poetry.readthedocs.io/
[pipx]: https://pipxproject.github.io/pipx/
Expand Down
Loading