Commit Graph

175 Commits

Author SHA1 Message Date
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
asymmetric
b414f942e0
doc: link, instead of just mentioning, Nix manual (#255126)
Instead of just telling the reader to go find the relevant section of the Nix
manual, let's just link to it. Yay hypertext!
2023-09-14 17:09:39 +02:00
figsoda
39c64e2323 doc/python: document pyproject and remove usages of format 2023-09-12 19:54:43 -04:00
Alejandro Sanchez Medina
13e4891d6d nixpkgs manual: doc python: render manual notes as admonitions 2023-08-21 16:02:34 +02:00
Alejandro Sánchez Medina
8cd56a3b7a
Documentation: nixpkgs manual: move Python reference to the top of Python chapter (#247117)
* nixpkgs manual, doc Python: move Reference/Optimizations to FAQ

See https://github.com/NixOS/nixpkgs/issues/246234.

* nixpkgs manual, doc Python: move Reference/python-optional-dependencies to FAQ

See https://github.com/NixOS/nixpkgs/issues/246234.

* nixpkgs manual, doc Python: move Reference/Tools to FAQ

See https://github.com/NixOS/nixpkgs/issues/246234.

* nixpkgs manual, doc Python: move Reference/deterministic-builds to FAQ

See https://github.com/NixOS/nixpkgs/issues/246234.

* nixpkgs manual, doc Python: move Reference/automatic-tests to FAQ

See https://github.com/NixOS/nixpkgs/issues/246234.

* nixpkgs manual, doc Python: move Reference to top section

See https://github.com/NixOS/nixpkgs/issues/246234.
2023-08-17 14:45:29 +02:00
github-actions[bot]
4507a6bd1f
Merge master into staging-next 2023-08-08 00:01:49 +00:00
Alejandro Sánchez Medina
c72480119a
nixpkgs manual, doc Python: render interpreters in a table (#246956)
* nixpkgs manual, doc Python: render interpreters in a table

The current paragraph presenting Python interpreters is verbose and hinders clarity. The information provided is well suited to be rendered as a table.

Co-authored-by: Shahar "Dawn" Or <mightyiampresence@gmail.com>

* nixpkgs manual, doc Python: fix typos in interpreters' table

* nixpkgs manual, doc Python: update header in interpreters' table

* nixpkgs manual, doc Python: get rid of empty block code workaround in interpreters' table

---------

Co-authored-by: Shahar "Dawn" Or <mightyiampresence@gmail.com>
2023-08-07 23:48:22 +02:00
Doron Behar
6560d0086c python3.pkgs.pypaBuildHook: init 2023-07-28 12:13:25 +02:00
Doron Behar
1298c367b1 pip-build-hook.sh: Support $pipBuildFlags 2023-07-28 12:13:25 +02:00
Doron Behar
5262a7d1c9 doc/python: Demonstrate how to override the blas implementation 2023-07-28 12:13:25 +02:00
Sandro Jäckel
0a47d54801
docs/python: clarify allowance of using toosl to autogenerate packages 2023-07-24 16:41:08 +02:00
amesgen
906102c911
doc/languages-frameworks/python: don't use full pkgs in attrs 2023-06-29 21:38:37 +02:00
Lele Gaifax
06375c5962 doc/languages-frameworks/python: add missing back quote 2023-06-12 16:21:11 +02:00
figsoda
2bfb2f045a pypi2nix: remove
It has been broken since 2021 and upstream has been archived
2023-06-03 16:44:43 +02:00
figsoda
999652eb33 doc/python: remove usages of fetchPypi aliases 2023-05-21 11:28:13 -04:00
Martin Weinelt
35650d8be3
doc/languages-frameworks/python: update formatting and interpreters
Updates all interpreter references with 3.10/3.11, which are the
current version, that we recurse into for their package set.

Update all code examples with an explicit `format` and expand lists
with multiple items as we do in the python package set. Also set
`pythonImportsCheck` where tests are disabled.
2023-05-20 03:31:35 +02:00
pennae
052bb41410 doc: assign ids to many headings
without stable ids on headings we cannot generate stable links to these
headings. nrd complains about this, but the current docbook workflow
does not.

a few generated ids remain, mostly in examples and footnotes. most of
the examples are generated by nixdoc (which has since gained MD export
functions, and the MD export does generate IDs).
2023-03-27 22:39:11 +02:00
Artturi
1c6a1e5650
Merge pull request #218500 from alyssais/pythonForBuild 2023-02-27 18:17:27 +02:00
Martin Weinelt
0d09b95ad1 doc/python: Explain opt-out out of bulk updates 2023-02-27 02:21:07 +00:00
Alyssa Ross
2bfa93e01c
treewide: python{ => .pythonForBuild}.interpreter
It won't be enough to fix cross in all cases, but it is in at least
one: pywayland.  I've only made the change in cases I'm confident it's
correct, as it would be wrong to change this when python.interpreter
is used in wrappers, and possibly when it's used for running tests.
2023-02-26 20:26:17 +00:00
André Schröder
b2c8b539ac nixos/doc: fix typo in python.section.md 2023-02-01 23:00:16 +01:00
Noah Fontes
3bec41fb5e
doc/python: fix attr name for unittestCheckHook flags
The name should end in Array per the current conventions.

This change also contains some minor formatting fixes, as the heading
levels were inconsistent.
2023-01-28 13:19:41 -08:00