Skip to main content

PyPI Tests codecov.io Docs Nox

hotmodern-python

My Python learning project by article series 'Hypermodern Python' (by Claudio Jolowicz)

This repo 98% repeats code from these articles with little improvements for Windows environment (see below) and except several components (pre-commit, pytype, typeguard, Release Drafter)

Notes for Windows host

Updated: 2024-08-05

Functions with temp file on Windows

Windows has security limitation for temp files: OS does not allow processes other than the one used to create the NamedTemporaryFile to access the file (from here)

That's why I modified code like this:

# noxfile.py
import pathlib

def install_with_constraints(session: Session, *args: str, **kwargs: Any) -> None:
    """Install packages constrained by Poetry's lock file."""
    with tempfile.NamedTemporaryFile(delete=False) as requirements:
        session.run(
            "poetry",
            "export",
            ...
        )
        session.install("-r", f"{requirements.name}", *args, **kwargs)
    pathlib.Path(requirements.name).unlink()

Run Nox sessions with pyenv's Python versions

On Windows I use pyenv-win for managing Python interpreter versions.

If you set up pyenv-win correctly, it lets you run your session against multiple interpreters by specifying python to @nox.session (and run sessions the same way as on Linux machines).

@nox.session(python=["3.11", "3.12"], reuse_venv=True)
def tests(session: Session) -> None:
...

The main thing you should do is setting paths to Python interpreters in the right order in your PATH environment variable on Windows.
I wrote a detailed tutorial on their wiki page Configure the order in PATH variable
But to avoid many problems related to discover a Python interpreter version, you also have to add paths for all installed versions of Python "below" (after) path to ...\pyenv-win\shims For example your PATH might look as:

D:\python_tools\.pyenv\pyenv-win\bin
D:\python_tools\.pyenv\pyenv-win\shims\
D:\python_tools\.pyenv\pyenv-win\versions\3.8.10
D:\python_tools\.pyenv\pyenv-win\versions\3.9.13
D:\python_tools\.pyenv\pyenv-win\versions\3.10.8
D:\python_tools\.pyenv\pyenv-win\versions\3.11.2
D:\python_tools\.pyenv\pyenv-win\versions\3.12.4

Metadata

Release files for hotmodern-python 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hotmodern-python 0.1.2
File Size Uploaded Provenance
hotmodern_python-0.1.2.tar.gz 4.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for hotmodern-python 0.1.2
File Interpreter ABI Platform
hotmodern_python-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / hotmodern_python-0.1.2.tar.gz

Download URL hotmodern_python-0.1.2.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e36f0454e7ee946d3aa848182cbaf59c315ae58baeb0da0a8fca4952cef56d98
BLAKE2b-256 checksum
How to use checksums
908fa80fe7a145eca44707590f14be196f6f22e6de361c3f37ddb5e34d455b4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / hotmodern_python-0.1.2-py3-none-any.whl

Download URL hotmodern_python-0.1.2-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de4456aa5af9bd9195ea43cd2f226cf9973d101536c5b900615831570b30e0cc
BLAKE2b-256 checksum
How to use checksums
ed138af61a2de08130a4524610533bc7f3abd109a185663ffef7265a1243d2c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Security for hotmodern-python 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page