Comments (5)
Thank you for reporting this issue. A warning in my IDE made me aware of this issue. Moving away from pkg_resources will require a rewrite of the req2flatpak's RequirementsParser
class. I would appreciate any help, contributions welcome!
- the
packaging
package provides functionality for parsing requirements, see https://packaging.pypa.io/en/stable/requirements.html ...it should be fairly easy to use this functionality. Maybe we can vendor the functionality instead of introducing a hard dependency on the packaging package. - not sure, does importlib also provide functionality for parsing requirements? this would have the advantage that we dont need external packages.
from req2flatpak.
I was only made aware of this when I dug around in your code after I got a Error parsing requirements: A single version number must be specified.
error. Apparently not having a version specified for a package in requirements.txt causes this error. Should I file another bug report for this?
from req2flatpak.
That error message is not a bug, but a deliberate scoping/design decision for req2flatpak. Some explanation:
What does the error message "A single version number must be specified" mean? - It means that for each package that you specify in your requirements.txt, the version number must be fixed, also known as "frozen". I.e., a single version number. No ranges, no "greater than" constrains, but a single version.
Why does req2flatpak have this limitation? Why does it only accept a single, fixed version number for each package? - That is because req2flatpak aims to do one thing well. It aims to be good at creating a flatpak manifest for a set of fully resolved dependencies with frozen version numbers. In contrast, req2flatpak does not resolve dependencies, nor does it freeze versions.
How then is req2flatpak meant to be used? How can you get a list of fully resolved, frozen dependencies for your project? Many tools exist for this purpose. E.g., poetry, pip-tools, and many others. For example if you are using poetry, you can use the poetry export command to export a requirements.txt file that is fully resolved and frozen. In the same way, if using pip-tools, you can use the pip-compile command to resolve your dependencies and freeze your package versions.
Hope this helps! Best regards, Johannes
from req2flatpak.
Ah ok. Any chance that req2flatpak could be made to use these tools internally to resolve the dependencies?
from req2flatpak.
No, I won't include any one of these tools internally into req2flatpak.
Why? First, dependency resolution and the freezing of versions is no simple task. Second, a one-size-fits-all solution that most people agree on simply does not exist. To find out more, you can search for "python packaging hell", pip compile, poetry, pdm, pep 517, pep 582, pipenv, flit, hatch, or read through some official or opiniated articles. I want to strictly avoid tying req2flatpak too closely to any one of these tools.
from req2flatpak.
Related Issues (20)
- consider adding a linter HOT 1
- allow specifying target platforms as platforminfo.json files HOT 1
- Contributors and Maintainers welcome HOT 2
- display help if invoked without commandline args
- Run tests in a matrix of python versions and system architectures HOT 5
- Announce the project over on gnome discourse HOT 2
- automatically publish tagged versions on pypi HOT 1
- request for --yaml option HOT 2
- `make test` fails: Poetry configuration is invalid: Additional properties are not allowed ('group' was unexpected) HOT 2
- pre-commit fails with pylama: 'bool' is not iterable HOT 3
- classmethod build_module_as_str is untested? HOT 2
- use yaml comments to note "generated by req2flatpak" HOT 3
- "generated by" comment includes path to req2flatpak HOT 9
- Contributors and Maintainers welcome HOT 3
- Let's release a v0.2 HOT 7
- Disable Wiki and add tags HOT 4
- docs: fix bullet lists by adding trailing whitespace HOT 3
- Newer versions of manylinux HOT 5
- Build fail for jellyfish HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from req2flatpak.