Skip to content
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

Open
15 of 37 tasks
domenkozar opened this issue Feb 23, 2014 · 18 comments
Open
15 of 37 tasks

Python ecosystem improvements (placeholder issue) #1819

domenkozar opened this issue Feb 23, 2014 · 18 comments
Assignees
Labels
0.kind: bug Something is broken 0.kind: enhancement Add something new 6.topic: documentation Meta-discussion about documentation and its workflow 6.topic: python

Comments

@domenkozar
Copy link
Member

domenkozar commented Feb 23, 2014

This is a placeholder for general improvements to Python packaging infrastructure in Nixpkgs.

Documentation

Python modules

Build functions

Packages

Tests

Issues to resolve

@domenkozar
Copy link
Member Author

cc @chaoflow @garbas @cillianderoiste @offlinehacker @matejc (anyone else)?

@domenkozar
Copy link
Member Author

cc @rach

@shlevy
Copy link
Member

shlevy commented Apr 5, 2014

Do you think it makes sense to make separate issues for more of these?

@domenkozar
Copy link
Member Author

For some todos, if more then one line is needed to describe what's needed to be done (and if some discussion is needed).

@kevinburke
Copy link

Readline support would be very nice. Currently arrow keys in the nix python interpreter don't work.

@domenkozar
Copy link
Member Author

@kevinburke could you describe exact steps to reproduce that? Stable or unstable channel?

@domenkozar
Copy link
Member Author

Updated TODOs to match current state in nixpkgs.

@domenkozar
Copy link
Member Author

@kevinburke once #4495 is merged, using pythonFull will mean readline support. For now you can use python and specify python.modules.readline as buildInput for your expressions.

@joelmo
Copy link
Contributor

joelmo commented Feb 11, 2015

I think this could be added under issues to resolve:
Import test for all derivations that add packages to site-packages folder. It would then be easier to detect if packages propagate all other packages needed for the basic import.

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.

@domenkozar
Copy link
Member Author

See #3821

@domenkozar domenkozar changed the title Python improvements (placeholder issue) Python ecosystem improvements (placeholder issue) Nov 21, 2015
FRidh added a commit to FRidh/nixpkgs that referenced this issue Dec 14, 2015
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
@jagajaga
Copy link
Member

jagajaga commented Mar 6, 2016

P-p-p-ping :)

@datakurre
Copy link
Contributor

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.

@FRidh
Copy link
Member

FRidh commented Sep 30, 2016

You could keep a default.nix file in the repo, and use src = ./.; , and
then fetch the repo and import it or use callPackage. However, you will
then import from another derivation, and this is currently not supported on
Hydra.

@RonnyPfannschmidt
Copy link
Contributor

@datakurre have you considered always having your custom channel, and each default.nix overriding the src attribute of a derivation with the path ./.

@datakurre
Copy link
Contributor

@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.

@stale

This comment has been minimized.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 30, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 1, 2020
@stale
Copy link

stale bot commented Oct 1, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 1, 2021
@OliverEvans96
Copy link
Contributor

I think #91916 should be added to this list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 0.kind: enhancement Add something new 6.topic: documentation Meta-discussion about documentation and its workflow 6.topic: python
Projects
None yet
Development

No branches or pull requests

10 participants