-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Python ecosystem improvements (placeholder issue) #1819
Comments
cc @chaoflow @garbas @cillianderoiste @offlinehacker @matejc (anyone else)? |
cc @rach |
Do you think it makes sense to make separate issues for more of these? |
For some todos, if more then one line is needed to describe what's needed to be done (and if some discussion is needed). |
Readline support would be very nice. Currently arrow keys in the nix python interpreter don't work. |
@kevinburke could you describe exact steps to reproduce that? Stable or unstable channel? |
Updated TODOs to match current state in nixpkgs. |
@kevinburke once #4495 is merged, using |
I think this could be added under issues to resolve: The test itself is very simple (python -c 'import matplotlib, pkg1, pkg2'), but it requires the correct environment to be set up after the build. |
See #3821 |
The default command for running tests is `python setup.py test`. Many packages use a test runner that needs to be invoked, e.g. `nosetests` or `py.test`. It would be nice if `buildPythonPackage` automatically determines which command to run. We can check in the `buildInputs` whether `nose` or `pytest` is included, and if so, do either 1) or 2) 1. Run the appropriate command, `nosetests` or `py.test`. 2. Apply a patch to enable `python setup.py test`. For [py.test](http://pytest.org/latest/goodpractises.html#integrating-with- setuptools-python-setup-py-test-pytest-runner) and [nose](http://nose.readthedocs.org/en/latest/api/commands.html) Option 2) could get complicated/messy and therefore I'm in favor of option 1). This commit implements option 1. --- Reference to NixOS#1819
P-p-p-ping :) |
I'm in need of "improved" solution for managing a lot of in-house packages in setup, where we have normal python package development and custom nix channel. I'd prefer to have default.nix in each package repository to easily get development environments for each package. Yet, I would not like to manage duplicate buildPythonPackage-derivation in our in-house channel repository. Have you ever considered somehow supporting explicit release.nix / default.nix in Python source packages? Could it be any more dangerous than what setup.py already is? For my own usage, I might simply check if the package has default.nix, expect it to have buildPythonPackage derivation and call that. |
You could keep a default.nix file in the repo, and use src = ./.; , and |
@datakurre have you considered always having your custom channel, and each default.nix overriding the src attribute of a derivation with the path ./. |
@FRidh @RonnyPfannschmidt Thanks for those ideas! I was aware that Hydra-compatibility is an issue (didn't know that limitation of derivation not being able to call derivation though), so I probably should try @RonnyPfannschmidt's approach at first. Adding new packages and adding new dependencies for developed package would be a bit inconvenient, but for existing packages it would make default.nix look less scary (for non-nixers). I hope to end up with something that I could document as an example workflow with nix. |
This comment has been minimized.
This comment has been minimized.
I marked this as stale due to inactivity. → More info |
I think #91916 should be added to this list. |
This is a placeholder for general improvements to Python packaging infrastructure in Nixpkgs.
Documentation
propagatedBuildInputs
?PYTHONPATH
out of packages? (makePythonPath
in nix, andtoPythonPath
in bash)buildPythonPackage
need to addpython
topropagatedBuildInputs
(Python: some packages don't propagatepython
causing "nix-shell -p" to fail #17679, Python: split buildPythonPackage into two functions #18143)wrapPython
Python modules
readline
by default (adds 16M to the closure (nixpkgs python repl isn't very terminal-friendly #17607, Python: use separate output for tkinter #19309)ncurses
by default (Python 2.7 Full: sqlite3 module doesn't work in virtualenv #492 (comment), Python: use separate output for tkinter #19309)sqlite
by default (Python 2.7 Full: sqlite3 module doesn't work in virtualenv #492 (comment), Python: use separate output for tkinter #19309)tkinter.tix
doesn't yet function with$ nix-shell -p 'python.withPackages(ps: [ps.tkinter])' --run "python -c 'import Tix; Tix.Tk()'"
. Python tix module #21643 (review)Build functions
python
andbuildPythonPackage
setup-hooksnamePrefix
should be default empty and prefixed withpythonX.X-
only insidepython-packages.nix
(buildPythonApplication: use new function for Python applications #13124)buildPythonPackage
intopython.mkDerivation
(similar tocabal.mkDerivation
)distutils
/setuptools
(Python: split buildPythonPackage into two functions #18143)mkDerivation
usingdistutils
tobuildPythonPackage
convert allTypicallybuildPythonPackage
not usingdistutils
tomkDerivation
buildPythonPackage
orbuildPythonApplication
withformat = "other";
should be used. See the docs.magicalSedExpression
(Replace magic sed for Python argv[0] with a python wrapper. #11168)buildPythonPackage
shouldn't usepostFixup
(buildPythonPackage uses postFixup for itself #9204, 85a87f5)Packages
python-modules
folder to be either a module or an application (versioned pythonX.Y- prefix #1468)pypi2nix
: a tool to generate Nix expressions for Python packages.python-packages.nix
(Python: Fixed-point combinator #17428)Tests
setup.py
/nosetests
/py.test
) (python buildPythonPackage: check and run correct test command #11715)Issues to resolve
PYTHONPATH
(Depending on a python package without adding it to PYTHONPATH #11423)virtualenv
should usepythonFull
(Make virtualenv use pythonFull, not python #7134, Python: use separate output for tkinter #19309)pypy
) (Python: move interpreters #17339)ctypes.util.find_library
([python] ctypes.util.find_library should return full path to the library #7307)setuptools
namespaces are broken (give collisions) (python: setuptools namespaces are broken (give collisions) #2412, python-wrapper broken by recent re-factoring #1826)data_files
upstream issue (Patch upstream to correctly handle install_data/data_files in Python #4968)zc.recipe.egg
is brokenpypy
PYTHONPATH
is incomplete (pypyPackages: wrapped scripts are missing paths from PYTHONPATH #12948)manylinux1
(Python on Nix claims to be manylinux compatible #18484, Add support for PEP 513 "manylinux1" wheels #71935)The text was updated successfully, but these errors were encountered: