Skip to content

Conversation

@branchvincent
Copy link
Contributor

Fixes #39
Fixes #28
Closes #32

This includes both the LICENSE and sample directory in the sdist. It also has some
miscellanious cleanups and modernizations (dropping support for old pythons,
updating deps, adopting new packaging standards), explained in more detail in each commit.

Now, modern package managers can recognize and automatically install dev dependencies, such as uv:

$ git clean -xdf
$ uv run -m unittest -q
Using CPython 3.13.5 interpreter at: /opt/homebrew/opt/python@3.13/bin/python3.13
Creating virtual environment at: .venv
Installed 7 packages in 7ms
----------------------------------------------------------------------
Ran 85 tests in 0.052s

OK (skipped=1)

This is a more standard layout that allows
the next commit to easily include the LICENSE file
and sample/ directory in the sdist. Otherwise, we
would need ugly hacks like symlinks.
Flit can now automatically find and include the
LICENSE file but it doesn't hurt to be explicit.

With the inclusion of sample/, tests can now be
run from the sdist (important for downstream
distributions).
The venv isn't needed since we're already running
in an ephermal VM. And removing the redundant
default flags from `build` as recommended allow it
to build the wheel from the sdist, which is a good
sanity check to confirm that the sdist contains
everything the wheel needs.

See https://build.pypa.io/en/stable/index.html#python--m-build.
Dependency groups were defined in PEP 735, designed
as a standardized replacement for pip's
requirements.txt. These are now supported in pip
and other package managers like uv.

See https://peps.python.org/pep-0735/ and
https://packaging.python.org/en/latest/specifications/dependency-groups/.
Ruff has largely superseded flake8 due to its
impressive performance and re-implementation of
popular plugins.

Created via `uvx flake8-to-ruff .flake8`
Previous python versions have reached end of life,
with 3.9 support ending soon in October: https://endoflife.date/python

Pyupgrade issues were fixed with ruff by opting-in
to the UP rules: https://docs.astral.sh/ruff/rules/#pyupgrade-up
@usepowershell usepowershell requested a review from Copilot July 29, 2025 14:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the packaging configuration and build process by dropping support for old Python versions and adopting new packaging standards. It also includes both the LICENSE file and sample directory in the source distribution to fix several reported issues.

  • Updates minimum Python version from 3.6 to 3.9 and adopts modern dependency groups
  • Replaces flake8 with ruff for linting and updates CI workflows
  • Includes LICENSE and sample/ directory in sdist packaging

Reviewed Changes

Copilot reviewed 12 out of 51 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pyproject.toml Updates Python version requirements, adds dev dependency groups, includes LICENSE and sample/ in sdist
.github/workflows/build.yaml Modernizes CI workflow with updated actions and simplified dependency installation
.github/workflows/publish.yaml Updates publish workflow to use new packaging structure and Python 3.13
.flake8 Removes flake8 configuration file as it's replaced by ruff
.devcontainer/postCreate.sh Updates to use new dependency group installation method
tests/environment_variable_evaluation/test_environment_variables_braces.py Removes trailing comment from assertion
src/README.md Removes empty README file from src directory
pycomposefile/service/service_misc.py Modernizes super() call syntax
pycomposefile/service/service_environment.py Removes explicit file mode from open() call
pycomposefile/service/service.py Removes mem_reservation field
pycomposefile/secrets/init.py Removes explicit file mode from open() call
pycomposefile/compose_element/compose_datatype_transformer.py Removes unnecessary parentheses from class definition
Comments suppressed due to low confidence (1)

.github/workflows/build.yaml:17

  • Python 3.14 is not yet released and may not be available in GitHub Actions. Consider removing it or making it an allowed failure until it's officially released.
        python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

- name: Install pypa/build
run: |
python -m pip install -r requirements.txt
python -m pip install --group dev
Copy link

Copilot AI Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --group flag is not a valid pip option. This should likely be python -m pip install -e .[dev] or use a tool like uv that supports dependency groups.

Suggested change
python -m pip install --group dev
python -m pip install -e .[dev]

Copilot uses AI. Check for mistakes.
@usepowershell
Copy link
Owner

Thank you very much for this!

@usepowershell usepowershell merged commit 2260c52 into usepowershell:main Jul 29, 2025
5 checks passed
@branchvincent
Copy link
Contributor Author

@smurawski thanks for the quick reviews and releases!

@branchvincent branchvincent deleted the license branch July 29, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source distribution on PyPI is missing license Source tarball on PyPi is missing sample directory

2 participants