Commit Graph

219 Commits

Author SHA1 Message Date
DavHau
356de8e33a examples: update pip lock for aarch64-darwin 2024-09-26 14:18:45 +02:00
DavHau
f2df299742 examples: update pip lockfile 2024-09-26 14:06:22 +02:00
DavHau
c838c1041f examples/python: how to use pytorch from nixpkgs 2024-09-26 14:06:22 +02:00
phaer
601b7dfd2b editables: fix path ordering, remove relics...
...of the former feature which linked sources in .dream2nix/editables.
This was sadly uncleanly removed before
2024-07-29 18:26:02 +02:00
phaer
23e728be98 docs/pip: document devShells 2024-07-29 13:22:22 +02:00
phaer
3b42196ab9 fix python-packaging-pillow lockfile 2024-07-29 13:22:22 +02:00
phaer
1b8d980b74 treewide: mytool -> my_tool
Keep naming consitant, so that nix run .# and friends work
2024-07-29 13:22:22 +02:00
phaer
ebdb0fe3a6 examples: update pillow & its python 2024-07-29 13:22:22 +02:00
phaer
b0c02b3ae0 add darwin lock-files 2024-07-29 13:22:22 +02:00
phaer
ee8e6ef05f examples: update pip editables comment...
...wasn't updated after function changes in 9448df1fa1
2024-07-29 13:22:22 +02:00
phaer
26c7bf108d examples: update pillow & its python 2024-07-29 13:22:22 +02:00
phaer
30b812bd81 update outdated aarch64-darwin lock files 2024-07-26 18:29:33 +02:00
phaer
e24cee1b7e update outdated x86_64-linux lock files 2024-07-26 18:26:46 +02:00
phaer
c65544bba0 update outdated aarch64-darwin lock files 2024-07-26 16:55:35 +02:00
phaer
0a7fefa2c4 add darwin lock-files 2024-07-13 16:40:01 +02:00
phaer
f679e624b4 add x86_64-linux lock files 2024-07-13 16:40:01 +02:00
phaer
2e5cf4294d set paths.lockfile for pip example...
even with the new default, it's good to be explicit.
And the examples will still refer to the main branch while running ci
checks for this
2024-07-13 16:40:01 +02:00
Paul Haerle
c674abab6d
Drop mitmproxy, pypiSnapshotDate (#1011)
* drop mitm-proxy & pypi snapshot date

* add warning if pypiSnapshotDate is used

* tree-wide: remove pypiSnapshotDate

* pip/tests/packages: support all platforms

* re-lock examples

* apache-airflow: fix override after re-lock

* pip/tests: remove other platforms again

...don't want to maintain 4 lock files per test
2024-07-09 15:51:13 +07:00
phaer
6ce06d44fb examples/rust-packaging: add iconv on darwin 2024-06-28 21:13:46 +02:00
phaer
42282329b0 tree-wide: make examples eval on all platforms...
all 4 default platforms of nixpkgs that is.
2024-06-28 21:05:33 +02:00
phaer
223674de3d fix: python-local-development example 2024-06-27 12:59:55 +02:00
phaer
cfd9c4f4c2 fix apache-airflow example 2024-06-27 12:49:03 +02:00
phaer
97d181ccd8 treewide: format = "pyproject" -> pyproject = true
It's important to get the default in our PDM module fixed,
because upstream documentation recommends using pyproject = true;
and ships an assertion assertion '((pyproject != null) -> (format ==
null))' that fails with the current default in pdm.
2024-06-27 12:26:08 +02:00
DavHau
ef04683222 fix: nix flake show requiring IFD 2024-06-27 08:24:28 +00:00
phaer
3f14177388 examples/hello: 2.12 -> 2.12.1 2024-06-26 19:05:13 +02:00
purepani
e1ea06ffd3
python: Moves python-local-development example into src layout 2024-06-23 15:20:11 -05:00
purepani
3ebbda3982
pdm: Adds example for pdm 2024-06-11 11:16:01 -05:00
purepani
bee7a60b36
pip: Change example package to remove hyphen 2024-06-09 13:42:05 -05:00
Paul Haerle
6a169a73bd
Python DevShells (for pip) (#951)
* fetchPipMetadata: set meta.mainProgram

* fetchPipMetadata: deduplicate test fixtures

* fetchPipMetadata: add is_direct to lock file

* devShell: proof of concept

* python-local-development: add editables example

* devshell: simplify editables interface

* buildPythonPackage: remove editable option again

* devshell: use findRoot for editables

* devshell: add support for .whl sources

* devshell: avoid polluting the shells environment

* devshell: make editable.nix flatter

because there's only 1 attr left now

* devshell: fix pyEnv by filtering editables

from the environment.

* devshell: skip existing editables

* devshell: remove patched pyEnv, rewrite sys.path

* devshell: add special case for root package

* python-local-development: improve editable example

* python-local-development: filter source

* devshell: reset site_dir on each load

* pip: don't ignoreCollisions in pyEnv

* pip: default to no sitecustomize.py...

and teach the devshell how to load it

* pip: rewrite editable in python

* editable: use shutil.copytree

* editable: refactor into functions

* editables: add suport for console_scripts

* improve pip editables interface

- change editables interface to use bool or path
- expose public.shellHook for composition
- use shellHook by default in public.devShell
- extend example to include a script

* improve edtiable support:

- remove dependency on root package build
- always set root package as editable by default
- compute dit-info dir by calling a packages build backend or extracting directly from the wheel
- only pass required sources to editables shell hook
- add build inputs of all editables to teh dev shell
- move editables state to .dream2nix/python to remove likelyhood of collision with other ecosystems state
- delete editables state if editables configuration changed

* refine python editable support:

- never copy dependency sources
- force user to specify a local path

---------

Co-authored-by: DavHau <hsngrmpf+github@gmail.com>
2024-05-17 01:00:09 +02:00
DavHau
beceb215cc examples/python: fix apache-airflow example 2024-03-25 06:15:31 +00:00
DavHau
87c725e8db python: remove catchConflicts = false overrides
Those are not needed anymore since the hook has been improved in nixpkgs
2024-03-17 07:32:33 +00:00
DavHau
b727a07775 override: unify overriding across modules
Add options `overrides.${name}` and `overrideAll` to all language modules that manage a dependency tree.

This is done in a backward compatible fashion. Old options for overriding dependencies continue working, though those are not displayed in the manual anymore.

For the following modules the manual now suggest using the new unified override options:
- for pip: use `pip.overrides` and `pip.overrideAll` instead of  `pip.drvs`
- for nodejs-granular-v3: use `nodejs-granular-v3.overrides` and `nodejs-granular-v3.overrideAll` instead of `nodejs-granular-v3.deps`
- `php-granular`: use `php-granular.override` and `php-granular.overrideAll` instead of `php-granular.deps`
2024-03-13 14:25:41 +07:00
DavHau
211528826c cleanup core options
- don't import eval-cache and flags modules by default (those have never been used so far)
- mark options of package-func as internal. Those are for maintainers only and don't need to be rendered by default
2024-03-12 09:41:59 +00:00
DavHau
a1d2290029 docs: fix template attr in examples readme 2024-03-12 07:33:46 +00:00
DavHau
deb4c98014 docs: fix links to examples 2024-03-11 10:41:05 +00:00
DavHau
42838c5909 examples: cleanup and rename to simplify
- name example more consistently, eg. `{language}-packaging-{feature}` or `{language}-local-development-{feature}`
- move some examples to the modules integration tests directory instead as their purpose was mainly testing and they weren't good example
- module owned checks: import via flake if available
2024-03-09 04:45:59 +00:00
DavHau
887022b8c1 update nixpkgs:
- downgrade mitmproxy to avoid breakage
- add test for pip lock script
- fix bug in flake compat implementation (https://github.com/nix-community/flake-compat/pull/4#issuecomment-1950301370)
- small fix in docs for lock and eval-cache
- fix lock refresh script: don't swallow errors
2024-02-24 13:47:45 +00:00
Johannes Kirschbauer
8a040b7a96 nodejs: add simple nextjs example 2024-02-15 07:22:18 +00:00
DavHau
16f2c654c6 pdm: stop using config.deps.python3 in favor of config.deps.python 2024-01-24 08:09:56 +00:00
DavHau
0fb528d452 pdm: refresh pdm.lock on 'nix run .#{package}.lock' 2024-01-07 17:40:55 +00:00
DavHau
0f2d06b43e examples: add readme for packages examples 2024-01-07 06:28:34 +00:00
DavHau
67c1356f20 update nixpkgs 2023-12-12 09:52:44 +00:00
DavHau
c25e88974f nodejs-devshell-v3: init 2023-11-17 07:35:09 +00:00
DavHau
8db4cb1121 examples: minimize nodejs-project example 2023-11-15 08:44:40 +00:00
DavHau
7cb0fded82 nodejs: fix backward compat for nodejs-package-json
- revert recent changes on nodejs-package-json
- instead introduce nodejs-package-json-v3

This way, existing users won't face breakages in the api
2023-11-08 07:34:15 +00:00
DavHau
24e81d5ce8 examples: rename repo examples 2023-11-07 19:08:27 +07:00
DavHau
1c47a7cfba examples: move repo-flake-groups to /misc/drafts 2023-11-07 19:08:27 +07:00
DavHau
3030cd5877 examples/python-pdm: migrate to ./packages 2023-11-07 19:08:27 +07:00
DavHau
bce7ab631d nodejs-package-json: use v3 lock file 2023-11-07 18:45:35 +07:00
DavHau
d8e4b477e3 refactor: move dev related things to /dev-flake
The goal is to reduce the flake inputs visible to the user
Still, the top-level flake re-exposes the outputs of the dev-flake, but
without exposing its inputs. This means a devShell is still available in
the top-level, for example.

This also removes the /modules/flake.nix. Its original purpose was
separating the modules inputs from the development inputs, but this is
now done the opposite way around by moving the dev inputs to
/dev-flake/flake.nix.
2023-11-05 03:42:18 +00:00