Skip to content

Comments

Convert to pyproject.toml and update CI#47

Merged
anwarnunez merged 6 commits intogallantlab:mainfrom
kroq-gar78:pyproject
Nov 7, 2025
Merged

Convert to pyproject.toml and update CI#47
anwarnunez merged 6 commits intogallantlab:mainfrom
kroq-gar78:pyproject

Conversation

@kroq-gar78
Copy link
Collaborator

All package dev and production dependencies have been consolidated into pyproject.toml . setup.py did not specify all the required packages, so it could not be pip install'd without errors.

CI now also runs tests on Python 3.13.

Note that I saw a defaults.cfg mentioned in setup.py , but I'm not actually familiar with this repo, so I'm assuming it's not used anywhere.

@mvdoc mvdoc requested a review from Copilot October 29, 2025 00:11
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 migrates the project from legacy setup.py and requirements.txt files to a modern pyproject.toml-based configuration, aligning with PEP 517/518 standards. The migration includes updates to CI/CD workflows, removal of Travis CI configuration, and modernization of the build and installation process.

  • Migration from setup.py to pyproject.toml for project configuration
  • Updated GitHub Actions workflows to use pyproject.toml and Python 3.9-3.13
  • Removed legacy files (setup.py, requirements.txt, test_requirements.txt, .travis.yml)

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pyproject.toml New project configuration file with build system, dependencies, and dependency groups
setup.py Removed legacy setup script
requirements.txt Removed in favor of pyproject.toml dependencies
test_requirements.txt Removed in favor of pyproject.toml test dependency group
.travis.yml Removed legacy Travis CI configuration
.github/workflows/run_tests.yml Updated to use pyproject.toml, Python 3.9-3.13, and new installation method
.github/workflows/build_docs.yml Updated to use pyproject.toml and Python 3.13
.github/workflows/publish_to_pypi.yml Updated to use modern python -m build instead of setup.py
README.rst Updated installation instructions to remove setup.py reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Image Processing",
]
requires-python = ">=3.6"
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

The requires-python constraint specifies Python >=3.6, but the CI workflow tests against Python 3.9-3.13 only (line 14 of run_tests.yml). This mismatch could lead to compatibility issues. Consider updating requires-python to >=3.9 to match the tested versions, or expand CI testing to include Python 3.6-3.8 if older versions need to be supported.

Suggested change
requires-python = ">=3.6"
requires-python = ">=3.9"

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change will break compatibility with Python <= 3.8. If you make this change and then try to install the package in a 3.8 env, it will error.

sudo apt-get update
sudo apt-get install -y --no-install-recommends libblas-dev liblapack-dev libopenblas-dev ffmpeg libx264-dev
pip install --upgrade pip setuptools
pip install -e . --group test
Copy link

Copilot AI Oct 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. For PEP 735 dependency groups defined in pyproject.toml, you should use pip install -e .[test] with the optional dependency syntax, or consider using a tool like uv that supports the --group flag. Alternatively, install the dependencies separately: pip install -e . && pip install pytest pytest-cov codecov scikit-image.

Suggested change
pip install -e . --group test
pip install -e .[test]

Copilot uses AI. Check for mistakes.
pip install -e . --no-build-isolation
sudo apt-get install -y --no-install-recommends ffmpeg
pip install --upgrade pip setuptools
pip install -e . --group docs --no-build-isolation
Copy link

Copilot AI Oct 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. For PEP 735 dependency groups defined in pyproject.toml, you should use pip install -e .[docs] with the optional dependency syntax, or consider using a tool like uv that supports the --group flag. Alternatively, install the dependencies separately: pip install -e . --no-build-isolation && pip install numpydoc ipython Sphinx sphinx-gallery sphinx-rtd-theme sphinx-bootstrap-theme.

Suggested change
pip install -e . --group docs --no-build-isolation
pip install -e .[docs] --no-build-isolation

Copilot uses AI. Check for mistakes.
Repository = "https://github.com/gallantlab/pymoten"
Issues = "https://github.com/gallantlab/pymoten/issues"

[dependency-groups]
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

The [dependency-groups] table is part of PEP 735, which is a recent addition to Python packaging standards. Standard pip doesn't support this yet. Consider using [project.optional-dependencies] instead for broader compatibility, which would allow installing groups with pip install -e .[test] or pip install -e .[docs]. This approach is more widely supported and compatible with standard pip.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Interestingly Copilot is out of date by 6 months. Pip 25.1 (rel. April 2025) supports dependency groups: https://discuss.python.org/t/announcement-pip-25-1-release/89702

@anwarnunez
Copy link
Contributor

Thanks for the PR @kroq-gar78 !

It looks good to me. I'm happy to merge this in as-is.
w.r.t. Python 3.8: I'm ok either way. I'm for ignoring the Copilot suggestion and keeping 3.8 support unless others think otherwise.

@mvdoc : Are you good with these changes, too?

@mvdoc
Copy link
Contributor

mvdoc commented Nov 6, 2025 via email

@anwarnunez anwarnunez merged commit 1686a7b into gallantlab:main Nov 7, 2025
13 checks passed
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.

3 participants