Skip to content

Loosen dependencies requirements #341

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

Closed
Zaczero opened this issue Jan 24, 2025 · 5 comments · Fixed by #352 · May be fixed by #342
Closed

Loosen dependencies requirements #341

Zaczero opened this issue Jan 24, 2025 · 5 comments · Fixed by #352 · May be fixed by #342

Comments

@Zaczero
Copy link

Zaczero commented Jan 24, 2025

https://github.com/stac-utils/pgstac/blob/main/src/pypgstac/pyproject.toml

Such pinning makes it impossible to integrate this tool into other projects (without hacky workarounds like override-dependencies, forceful dependency overrides). And I assume the intention is to allow such use cases given the existence of py.typed file which otherwise would be redundant.

There exist online resources on this topic: https://discuss.python.org/t/should-i-be-pinning-my-dependencies/13159

A popular and good practice is to use >= for defining your dependencies.

@hrodmn
Copy link
Collaborator

hrodmn commented Jan 24, 2025

Hi @Zaczero - thanks for opening the issue. I appreciate the challenges that the strict dependency requirements might impose on using pypgstac within a larger project, but I have not run into that recently. Is there a particular dependency that is causing the problem in your case?

Feel free to open a pull request with the changes you described! It might be fine to open everything up with >= but I suspect there is a reason at least some of them have been pinned to specific versions.

Zaczero added a commit to Zaczero/pgstac that referenced this issue Jan 27, 2025
Also remove unused packages: flake8, types-setuptools
@bitner
Copy link
Collaborator

bitner commented Feb 10, 2025

The problem with >= is that you run into the strong possibility that you can get a breaking change in one of your dependencies.

@zstatmanweil
Copy link
Contributor

zstatmanweil commented Feb 20, 2025

I am also struggling with integration because of the strict dependency versions. Although I do understand @bitner's point. I do see another PR opened in December also tried to loosen some dependencies: #331. Are you more comfortable with that method that limits it to anything prior to the next major release?

@Zaczero
Copy link
Author

Zaczero commented Feb 21, 2025

@bitner

Strictly pinning minor versions (like package==1.2.3 or package==1.2.*) in Python dependencies creates unnecessary problems in real-world applications. When multiple packages in a project need different minor versions of the same dependency, this leads to "dependency hell" where pip cannot resolve the dependencies at all. This is especially problematic when your package needs to coexist with others in larger projects.

The Python ecosystem works best when packages specify reasonable version ranges (like package>=1.2). This ensures you get security patches and bug fixes while still maintaining control over major version changes. The more strictly you pin versions, the more likely your package becomes unusable as part of a larger software stack (which is the case).

Please look around the Python ecosystem, including well-established projects, and see that strict version pinning is an exception from how it's typically done. Your argument for strict pinning might make sense, but it goes against established practices in the Python ecosystem and creates real problems for users trying to integrate multiple packages together.

@zstatmanweil
Copy link
Contributor

I suggest as a compromise package>=1.2,<2.0 to limit to the current major version, which is what https://github.com/stac-utils/pgstac/pull/331/files is doing for a couple of the packages.

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 a pull request may close this issue.

4 participants