Skip to content

Conversation

@BALJAPALLIANSHUL
Copy link

Summary

This PR consolidates project metadata and dependencies into pyproject.toml following PEP 621 standards, as discussed in Issue #186.

Key Changes

  • Consolidation: Migrated all data from setup.cfg and requirements.txt into the [project] section of pyproject.toml.
  • Standardization: Resolved minor inconsistencies in dependencies:
    • Kept urllib3<2.0.0 (from requirements.txt) to ensure compatibility.
    • Standardized requests to >=2.7.
  • Documentation: Updated CONTRIBUTING.md to reflect the new installation process.
  • Cleanup: Removed the now-obsolete setup.py, setup.cfg, and requirements.txt files.
  • Verification: Confirmed standard installation works and all tests pass (47/47) with the new configuration.

- 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"
Copy link
Collaborator

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.

Copy link
Author

Choose a reason for hiding this comment

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

done!

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]
Copy link
Collaborator

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?

Copy link
Author

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.

Copy link
Author

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.

@ayushanand18
Copy link
Collaborator

@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
Copy link
Collaborator

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

Copy link
Author

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.

  1. 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.
  2. 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.

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