Convert to pyproject.toml and update CI#47
Conversation
There was a problem hiding this comment.
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.pytopyproject.tomlfor project configuration - Updated GitHub Actions workflows to use
pyproject.tomland 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" |
There was a problem hiding this comment.
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.
| requires-python = ">=3.6" | |
| requires-python = ">=3.9" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
| pip install -e . --group test | |
| pip install -e .[test] |
| 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 |
There was a problem hiding this comment.
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.
| pip install -e . --group docs --no-build-isolation | |
| pip install -e .[docs] --no-build-isolation |
| Repository = "https://github.com/gallantlab/pymoten" | ||
| Issues = "https://github.com/gallantlab/pymoten/issues" | ||
|
|
||
| [dependency-groups] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
|
Thanks for the PR @kroq-gar78 ! It looks good to me. I'm happy to merge this in as-is. @mvdoc : Are you good with these changes, too? |
|
+1 let's merge
…On Thu, Nov 6, 2025 at 3:41 AM Anwar Nunez-Elizalde < ***@***.***> wrote:
*anwarnunez* left a comment (gallantlab/pymoten#47)
<#47 (comment)>
Thanks for the PR @kroq-gar78 <https://github.com/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 <https://github.com/mvdoc> : Are you good with these changes, too?
—
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABO5TGVVIZGRU7TMPT2DRL333MXU5AVCNFSM6AAAAACKCDNYRKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIOJWG43TCNBZHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Matteo Visconti di Oleggio Castello, Ph.D.
Assistant Project Scientist
Department of Neuroscience, UC Berkeley
MatteoVisconti.com <http://matteovisconti.com> || github.com/mvdoc ||
linkedin.com/in/matteovisconti
|
All package dev and production dependencies have been consolidated into
pyproject.toml.setup.pydid not specify all the required packages, so it could not bepip install'd without errors.CI now also runs tests on Python 3.13.
Note that I saw a
defaults.cfgmentioned insetup.py, but I'm not actually familiar with this repo, so I'm assuming it's not used anywhere.