Commit graph

196 commits

Author SHA1 Message Date
Martin Weinelt
0e1624df44
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
- pkgs/development/python-modules/pycdio/default.nix
2024-08-11 03:10:34 +02:00
Doron Behar
38e8fe7e3f doc/python: don't recommend all-packages.nix for Python applications 2024-08-07 12:02:11 +03:00
github-actions[bot]
3c2967ad03
Merge master into staging-next 2024-08-07 06:01:16 +00:00
OTABI Tomoya
6ff8fec735
Merge pull request #332784 from pbsds/doc-python-auto-remove-deps-hook-1722967990
docs/language-frameworks/python: pythonRemoveDepsHook is added automatically
2024-08-07 14:22:48 +09:00
Peder Bergebakken Sundt
6488c3d438 docs/language-frameworks/python: update python{,2,3}Package aliases 2024-08-06 20:16:59 +02:00
Peder Bergebakken Sundt
ef70f7d028 docs/language-frameworks/python: pythonRemoveDepsHook is added automatically 2024-08-06 20:15:54 +02:00
Martin Weinelt
0b0dd33e0a
python312Packages.setuptoolsCheckHook: remove
The hook relied on the `test` command passed to `setup.py`, which has
long been deprecated and finally removed in setuptools 72.0.
2024-08-06 18:18:40 +02:00
Arnout Engelen
b2d53203f2
docs: show pyproject = true; instead of format = "pyproject";
every other format is deprecated, so to imply that people should be setting it is misleading

(`pyproject = true` should also go away eventually, but is the way until
then)
2024-07-26 16:11:17 +02:00
Alexis Hildebrandt
ab42ca141a doc: Remove indefinite article and ending period from example meta.description
so that meta.description examples shown in the documentation
align with recommendations given in the "Meta attributes" section
in pkgs/README.md.

The changes were made with the following commands:
nix run nixpkgs#silver-searcher -- -l0 'description\s*=\s*"([Aa]n?|[Tt]he)\s' doc \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee '/description/s/"([Aa]n?|[Tt]he)\s(.)/"\U\2/'
nix run nixpkgs#silver-searcher -- -l0 'description\s*=\s*".*\."' doc \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee '/description/s/\."/"/'
2024-07-20 09:18:42 +02:00
Martin Weinelt
58ca021599
docs/language-frameworks/python: update relaxDepsHook docs 2024-06-14 14:51:23 +02:00
natsukium
513573a582
doc/languages-frameworks/python: update contributing section 2024-06-04 09:02:05 +09:00
natsukium
b6bf10bf70
doc/languages-frameworks/python: adjust expression to explanation 2024-06-04 09:02:05 +09:00
natsukium
ef61a6339c
doc/languages-frameworks/python: normalize pname and add description 2024-06-04 09:02:05 +09:00
natsukium
a4d5b56448
doc/languages-frameworks/python: fix typo 2024-06-04 09:02:05 +09:00
natsukium
8f9e861543
doc/languages-frameworks/python: add extra information for pythonRelaxDepsHook 2024-06-04 09:02:05 +09:00
natsukium
1b4462bb0c
doc/languages-frameworks/python: clean up build-system
add setuptools explicitly and remove wheel
2024-06-04 09:02:04 +09:00
natsukium
1c90c05bbc
doc/languages-frameworks/python: disable check explicitly and add pythonImportsCheck 2024-06-04 09:02:04 +09:00
natsukium
130da0dd42
doc/languages-frameworks/python: update the description for tests 2024-06-04 09:02:04 +09:00
natsukium
0a509b237a
doc/languages-frameworks/python: update the description for pypa builder/instller 2024-06-02 12:25:11 +09:00
Alejandro Sánchez Medina
0cb4674319
doc: autogenerate python interpreter table (#313408)
* doc: autogenerate python interpreter table

This serves as a practical example on generating documentation by
inspection of the evaluated Nixpkgs tree.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-05-23 10:36:15 +02:00
Frederik Rietdijk
5772ac5a75 Removing FRidh as active maintainer of packages
In the past I was very active with Python packaging.
For several years now I was hardly around as maintainer,
so it does not make sense I am listed as a maintainer for
these makes. Looking back, I should have removed myself
as maintainer already much longer ago. Anyway, better late
than never.

It's been a fun ride, and  I do intend to occasionally contribute
to Nixpkgs, but not in the same way it once was.
2024-04-28 12:20:07 +02:00
annalee
675fb1648e
Merge remote-tracking branch 'upstream/staging-next' into staging
Conflicts:
	pkgs/development/python-modules/apsw/default.nix
	pkgs/development/python-modules/deal/default.nix
	pkgs/development/python-modules/kubernetes/default.nix
2024-03-28 13:02:34 +00:00
Janne Heß
bc5ee2b8f8 treewide: Switch markdown placeholder from "..." to <...>
We use angle brackets since they look a lot like a placeholder while
also being valid nix code, as suggested by roberth here: https://github.com/NixOS/nixpkgs/pull/299554#discussion_r1541797970
2024-03-28 09:28:12 +01:00
Janne Heß
fcc95ff817 treewide: Fix all Nix ASTs in all markdown files
This allows for correct highlighting and maybe future automatic
formatting. The AST was verified to work with nixfmt only.
2024-03-28 09:28:12 +01:00
Janne Heß
bc77c7a973 treewide: Mark Nix blocks in markdown as Nix
This should help us with highlighting and future formatting.
2024-03-28 09:28:12 +01:00
Thomas Watson
26ccdea3d7 python3Packages.setuptoolsBuildHook: delete broken setuptoolsShellHook
Broken since the switch to PyPA's build/installer in
6c85fff302.

The hook was always janky and maintainers appear to not want its current
implementation in-tree. No replacement is currently planned.

However, this leaves the path open for future replacements as a broken
hook will no longer be installed by default.
2024-03-24 19:21:55 -05:00
Martin Weinelt
07717e430d
Merge pull request #297347 from tzx/docs-right-location-buildPytonPackage
doc: document name binding for buildPythonPackage
2024-03-21 05:53:08 +01:00
Timmy Xiao
a6b670edaa doc: document name binding for buildPythonPackage 2024-03-21 00:27:35 -04:00
Sarah Clark
2f7f71ea58
doc: Add troubleshooting for Cythonized code and pytest (#293069)
Cython is a Python compiler that emits native .so modules. By default, python derivations run tests in the wrong directory to see these modules and tests fail.

Issue #255262 documents the root cause and solution for this problem.

This PR adds a description of the problem and the most common solution to the test troubleshooting list.
2024-03-20 14:21:09 +01:00
Anderson Torres
e671d3bbbd Nix docs: remove with lib; from example code
Following [Best Practices](https://nix.dev/guides/best-practices#with-scopes),
`with` is a problematic language construction and should be avoided.

Usually it is employed like a "factorization": `[ X.A X.B X.C X.D ]` is written
`with X; [ A B C D ]`.

However, as shown in the link above, the syntatical rules of `with` are not so
intuitive, and this "distributive rule" is very selective, in the sense that
`with X; [ A B C D ]` is not equivalent to `[ X.A X.B X.C X.D ]`.

However, this factorization is still useful to "squeeze" some code, especially
in lists like `meta.maintainers`.

On the other hand, it becomes less justifiable in bigger scopes. This is
especially true in cases like `with lib;` in the top of expression and in sets
like `meta = with lib; { . . . }`.

That being said, this patch removes most of example code in the current
documentation.

The exceptions are, for now
- doc/functions/generators.section.md
- doc/languages-frameworks/coq.section.md

because, well, they are way more complicated, and I couldn't parse them
mentally - yet another reason why `with` should be avoided!
2024-03-06 11:40:09 -03:00
Martin Weinelt
14a12caecf
python38: remove
The end of life for Python 3.8 is scheduled for 2024/10. As such it
cannot be a part of NixOS 24.05, because its support cycle goes past
that.
2024-03-05 11:56:21 +01:00
Mihai Maruseac
c786e63c70
doc: Fix typo resulting in broken link in manual
I was looking at
https://nixos.org/manual/nixpkgs/stable/#buildpythonpackage-parameters to
import a Python package and noticed that the link for the `hooks` in
`pyproject` option is broken due to a typo (used <kbd>0</kbd> instead of
<kbd>)</kbd>).

Signed-off-by: Mihai Maruseac <mihai.maruseac@gmail.com>
2024-02-26 05:20:16 -08:00
github-actions[bot]
ba5eeff4f5
Merge master into staging-next 2024-02-20 06:01:15 +00:00
adisbladis
4d0cca4654 mk-python-derivation: Add build-system argument
Much like the previous commit that adds dependencies &
optional-dependencies this aligns PEP-517 build systems with how they
are defined in PEP-518/PEP-621.

The naming `build-system` (singular) is aligned with upstream Python standards.
2024-02-18 17:40:42 +13:00
adisbladis
b9138b7c07 mk-python-derivation: Add dependencies & optional-dependencies arguments
Since https://github.com/NixOS/nixpkgs/pull/161835 we've had the
concept of `passthru.optional-dependencies` for Python optional deps.

Having to explicitly put optional-dependencies in the passthru attrset
is a bit strange API-wise, even though it semantically makes sense.

This change unifies the handling of non-optional & optional Python
dependencies using the names established from PEP-621 (standardized pyproject.toml project metadata).
2024-02-18 17:40:42 +13:00
DavHau
a299915fff pythonCatchConflictsHook: improve docs 2024-02-13 11:15:41 +07:00
Martin Weinelt
01a2063317
doc/python: update buildPythonApplication example
It is fine to use `with` on the inputs, since that increases the
overall readability of the package.

Removes `wheel` from `nativeBuildInputs`, since it is a result of
cargo culting from an earlier setuptools example, that was wrong, and
it is not required, since it is provided by setuptools itself.
2024-01-01 23:39:38 +01:00
netali
fb8c363b6a
doc: fix python-updates branch name
The python-updates branch was formerly called python-unstable, but the
new branch name was never mentioned in the docs. This commit changes the
branch name in the docs to python-updates.
2023-12-28 21:54:36 +01:00
Artturi
6f726bd5aa
Merge pull request #256816 from Artturin/pythondocpython3packages 2023-11-10 20:25:00 +02:00
Arnout Engelen
97b0ae26f7
doc: avoid 'simply' (#266434)
While the word 'simply' is usually added to encourage readers, it often has the
opposite effect and may even appear condescending, especially when the reader
runs into trouble trying to apply the suggestions from the documentation. It is
almost always an improvement to simply drop the word from the sentence.

(there are more possible improvements like this, we can apply those in separate
PRs)
2023-11-09 21:48:05 +01:00
natsukium
a33d17fadc
doc/languages-frameworks/python: update recommended commit message 2023-11-09 11:27:22 +09:00
natsukium
bcb19b212c
doc/languages-frameworks/python: switch pythonPackages to python3Packages
Replaced with python3Packages except for the following to avoid misuse of pythonPackages
1. which we need for the explanation
2. which are replaced by python3Packages as variables
2023-11-09 10:55:05 +09:00
natsukium
224ea037e4
doc/languages-frameworks/python: update interpreters version 2023-11-09 09:56:00 +09:00
Adam Joseph
bc2d598878 treewide: change pythonForBuild to pythonOnBuildForHost 2023-11-05 17:42:12 -08:00
Martin Weinelt
7efc0b2418 doc/python: mention python313 2023-10-21 16:18:27 +02:00
Frederik Rietdijk
f4822bb295
Merge pull request #254309 from pbsds/flit-prune
python3Packages.flitBuildHook: remove
2023-09-25 11:34:15 +02:00
Alejandro Sánchez Medina
ade134ecd1
nixpkgs manual: doc python: add hyperlinks to Python section (#252156)
* nixpkgs manual: doc python: add hyperlinks to Python section

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-09-24 19:13:18 +02:00
Artturin
70aa345bec doc/python: use python3Packages instead of python3.pkgs
Allows splicing to work correctly

from issue 211340

>> 3: Discourage using package sets like python3.pkgs "directly"

> I think about 8 years ago I introduced this and it has been a clear mistake. Since then this pattern was copied throughout. We should indeed go to pythonPackages and also move the helpers such as buildEnv and withPackages into the package set, like haskell already had before.

- FRidh
2023-09-23 07:57:07 +03:00
Peder Bergebakken Sundt
bdda7b0a53 python3Packages.flitBuildHook: remove 2023-09-22 21:11:24 +02:00
Frederik Rietdijk
53dd1a6edb
Merge pull request #254136 from figsoda/python
python310Packages.buildPythonPackage: introduce pyproject option
2023-09-14 18:33:49 +02:00