-
Notifications
You must be signed in to change notification settings - Fork 12
chore: migrate project configuration to pyproject.toml (PEP 621) #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
chore: migrate project configuration to pyproject.toml (PEP 621) #202
Conversation
- consolidated metadata and dependencies from setup.cfg and requirements.txt into pyproject.toml. - standardized dependencies: kept urllib3<2.0.0 for compatibility, updated requests to >=2.7. - updated CONTRIBUTING.md to reflect new installation steps (removed requirements.txt). - verified installation and tests (47/47 passed).
pyproject.toml
Outdated
| dynamic = ["version"] | ||
| description = "Python client for OBIS" | ||
| readme = "README.md" | ||
| requires-python = ">=3.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe take this opportunity to bump to Python >=3.10 to keep it above the EoL line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
.github/workflows/tests.yml
Outdated
| strategy: | ||
| matrix: | ||
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| python-version: ["3.10", "3.11", "3.12"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cam we bump to 3.13 and 3.14? Are we missing any dependencies for those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pandas latest version (see new), urllib3<2.0.0, requests and requests cache support 3.13 and 3.14 both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we are using conda-forage in test environment as channel, I checked it as well.
|
@BALJAPALLIANSHUL there are some merge conflicts, could you please rebase your PR? |
| shell: bash -l {0} | ||
| run: | | ||
| python -m pip install -e . --no-deps --force-reinstall | ||
| python -m pip install -e . --force-reinstall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why are we removing --no-deps here. deps were installed in Setup Micromamba already right? this could increase CI time with force reinstall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I migrated dependencies in requirements.txt into pyproject.toml. But I did not migrate dev dependencies to it because of nbsphinx library. The library depends on pandoc tool which is non python. Such tools (depends on conda binaries) are automatically installed with micromamba, but pip cannot do it. And also micromamba cannot read the pyproject.toml. so I left dev dependencies separate and installed in Setup Micromamba. I removed the --no-deps because because it needs to install dependencies in pyproject.toml and prevent environment mismatch as well. I thought it won't significantly effect CI time as it will just skip already satisfied requirements.
I have 2 suggestions to this blunder let me know which one is better.
- I will move the contents of requirements-dev.txt into pyproject.toml under [project.optional-dependencies]. We use Micromamba only to provision the Python environment, but let pip handle the installation.
- Switch the CI from micromamba to uv. uv is significantly faster than both pip and conda for pure Python packages, and it natively handles pyproject.toml locking.
Summary
This PR consolidates project metadata and dependencies into
pyproject.tomlfollowing PEP 621 standards, as discussed in Issue #186.Key Changes
setup.cfgandrequirements.txtinto the[project]section ofpyproject.toml.urllib3<2.0.0(fromrequirements.txt) to ensure compatibility.requeststo>=2.7.CONTRIBUTING.mdto reflect the new installation process.setup.py,setup.cfg, andrequirements.txtfiles.