-
Notifications
You must be signed in to change notification settings - Fork 1
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
Manage python dependencies with setup.py/setuptools #29
Comments
ConfigMaster is an end-user server application and not a library, so I don't think it needs to (or should) be installable using setuptools/pip. If we ever wanted to include a setup.py, it would have to install the same dependencies (see https://github.com/getsentry/sentry/blob/master/setup.py for an example), or it would confuse people into using the wrong dependencies. We already pin all packages and sub-packages and you can just run |
Managing packages in this way makes it difficult to distinguish between those that our project directly depends on and the sub-packages. This would be easy to solve with a list of direct dependencies in the setup.py and a requirements.txt with the pip freeze output. Or is there a tool that is able to detect which packages are actually used and cleans up the environment/requirements.txt? |
Ah, I understand where you're coming from. Good point indeed. Still unconvinced that putting the unconstrained dependencies in setup.py is the proper solution (it's not a library, after all, and it's never going to be consumed as a package). I checked a few similar projects and everyone is doing it differently - guess Python packaging is still a mess. I suggest we put the direct dependencies in requirements.txt with loose constraints, and have a separate requirements_lock.txt which pins all versions to the exact hash 1, making the builds fully reproducible. There's pipfile 2 too, but it's not production-ready yet. |
The use of setup. py is of course not required to define our direct dependencies and generate a lock file including subdependencies for reproducible environments. However, I would like to point out the misunderstanding that setuptools is for "libraries". Setuptools describes a "project", regardless of its specific nature (except it is primarily a python project of course). But I agree, even though a lot has already improved, python packaging is still a mess. |
We'll also have to think about optional dependencies (django-auth-ldap, ...). |
Using setup.py/setuptools allows us to manage dependencies with relaxed version requirements in the setup.py (if any) and using the requirements.txt to pin the packages and sub-packages to the exact versions that are garanteed to work.
This makes it easy to do updates and have reproducable environment due to the included and pinned sub-packages.
The text was updated successfully, but these errors were encountered: