Commit graph

67 commits

Author SHA1 Message Date
Oleh Stolyar
a3655babd4 Do not leak projectDir into expressions
Fixes caching issues.
2020-03-12 13:06:06 +00:00
adisbladis
06d9687c0f
Prepare for release 1.6.0 2020-02-29 14:07:31 +00:00
adisbladis
2e55b2e95a
Remove the doc attribute
It was never really used by anything and it's output is not really
useful at this moment.
2020-02-29 14:07:28 +00:00
adisbladis
bb3c2d57d5
Add a default source filter when projectDir is used
Also use the same source filter for path deps.

The default source filter currently filters:
- Filters gitignore (if it exists, non-recursive)
- Filters pycache/pyc files
- Uses cleanSourceFilter to filter out .git/.hg, .o/.so, editor backup files & nix result symlinks
2020-02-29 12:05:23 +00:00
adisbladis
b85e2a6733
Set src to lib.cleanSource projectDir by default
Ideally we'd use `nix-gitignore` but that one fails when there is no
`.gitignore` file so it's not a sensible default.
2020-02-29 12:04:36 +00:00
adisbladis
090e2dd957
Add fixup hook
This hook should fix common mistakes like installing `tests` in
site-packages which leads to collisions.
2020-02-28 19:45:23 +00:00
adisbladis
1f413d27c9
Implement a proper fix for #52
We need to check pyproject.toml & poetry.lock constraints
_separately_.

Consider the following scenario:

- `poetry` depends on `tox` which in turn depends on `virtualenv`.

- `poetry` _also_ depends directly on virtualenv, but only for older
python versions.

In this case we don't want `virtualenv` as a direct input to `poetry`
but we _do_ want it as an input for `tox`.
2020-02-28 14:01:46 +00:00
adisbladis
7f7499462f
Set meta.platforms to something reasonable by default 2020-02-28 08:38:36 +00:00
Tobias Pflug
e1e3b90be2 Drop meta attribute for mkPoetryPackages/mkPoetryEnv
The `meta` attribute is only relevant for `mkPoetryApplication`
and can safely be dropped elsewhere.
2020-02-26 09:24:23 +01:00
adisbladis
9dae5620ea
Add projectDir parameter
Turns
```
poetry2nix.mkPoetryEnv {
    pyproject = ./pyproject.toml;
    poetrylock = ./poetry.lock;
    pwd = ./.;
    python = python3;
}
```

into
```
poetry2nix.mkPoetryEnv {
    projectDir = ./.;
    python = python3;
}
```
2020-02-25 14:40:36 +00:00
Tobias Pflug
b3870576f8 Provide withDefaults and withoutDefaults
This adds the convenience functions withDefaults and
withoutDefaults which simply wrap the provided argument in a list
either with or without the default poetry overrides.

Tests have also been adapted to make use of `withDefaults` where
appropriate.
2020-02-25 14:24:48 +01:00
adisbladis
f4110f181a
Remove poetryPkg argument from public APIs 2020-02-25 10:01:42 +00:00
adisbladis
5691ea49bd
Bump poetry2nix version number to 1.5.0 2020-02-24 12:42:20 +00:00
adisbladis
5d902c8bab
Slightly improve evaluation performance 2020-02-24 12:41:42 +00:00
Utku Demir
f4b70664c2
Expose mkPoetryPackages 2020-02-24 12:38:15 +00:00
adisbladis
4d9bee6f81
Refactor mkPoetryPython (mkPoetryPackages)
- Renamed mkPoetryPython to mkPoetryPackages as it's more descriptive
We intend to expose this function soon so a better name is in order.

- Put TOML parsing inside mkPoetryPackages to unify parsing and avoid double parsing.
2020-02-24 12:25:55 +00:00
adisbladis
dc88082f58
Add support for python version constraints from pyproject.toml
Pep508 markers alone are not always enough, see #50

This sadly introduces a minor breakage in `mkPoetryEnv`.
2020-02-24 12:25:51 +00:00
adisbladis
0367b93492
Turn pyproject.toml patching into a hook
We should not be setting pre/post phases as it's counter intuitive
when working with overrides.
2020-02-23 14:37:01 +00:00
Steve Purcell
71cdd20018 Remove "path" dependencies in indirectly referenced packages 2020-02-18 15:58:31 +13:00
adisbladis
2caffda3ef
Use the canonical name setuptools-scm
Nixpkgs calls this setuptools_scm which is a mismatch for pypi.

Create an alias so any setuptools-scm installed by a user impacts all packages.
2020-01-21 12:12:36 +00:00
adisbladis
7170aad633
Add Pypy support (#40) 2020-01-18 20:29:07 +00:00
Oleh Stolyar
58eb9e63a7 Make it possible to pass additional nativeBuildInputs
..to mkPoetryApplication
2020-01-17 15:45:16 +00:00
Oleh Stolyar
5c943c6964 Do not depend on contents of pwd (#38)
Prevent Nix from copying the project directory to store by removing it
from args passed to buildPythonApplication.
2020-01-17 14:39:51 +00:00
adisbladis
301760e845
Remove getAttrDefault
Nix has built-in syntax for this operation, so lets use it.
2020-01-13 00:27:10 +00:00
adisbladis
f394798d72
Add full operator support 2020-01-09 12:48:07 +00:00
adisbladis
2831d5e3e8
nixpkgs-fmt all the things 2020-01-02 22:23:07 +00:00
adisbladis
45ab57b0e3
Bump version to 1.1.0 2020-01-02 21:57:35 +00:00
adisbladis
e9e5ce266e
Allow taking functors as overlays
This allows for making the default overrides customisable by exposing
them as a set with an override function.
2020-01-02 21:56:08 +00:00
adisbladis
9b33e9e3b6
Make overrides export the overlay function
This is preparation work for providing a function that allows
customising the overrides.
2020-01-02 18:07:14 +00:00
adisbladis
e121613551
Fix nixpkgs-fmt 2020-01-01 18:31:00 +00:00
adisbladis
c540d55971
Use lib.composeExtensions instead of hacky bespoke overlay implementation 2020-01-01 18:27:36 +00:00
adisbladis
589dd0617a
Fix nixpkgs-fmt 2020-01-01 18:01:11 +00:00
adisbladis
2c576409be
Add documentation output 2020-01-01 17:59:19 +00:00
adisbladis
4c24b3d49e
Add Nixdoc compatible docstrings 2020-01-01 17:49:12 +00:00
adisbladis
927ae249ef
Get license information from nixpkgs lib 2020-01-01 17:03:23 +00:00
adisbladis
c499f3b342
Change meta.licenses to meta meta.license 2020-01-01 16:44:56 +00:00
adisbladis
4acf604723
Add support for local path dependencies 2019-12-29 13:20:35 +00:00
adisbladis
bf48f272c1
Add CLI to supplement git hashes
This is not required for private repos where builtins.fetchGit would
suffice but _is_ required for Hydra (nixpkgs) where builtins.fetchGit is not allowed.
2019-12-28 21:45:51 +00:00
adisbladis
737ed5a372
Add Git support 2019-12-27 19:17:35 +00:00
adisbladis
908c9b8881
Restrucure overrides as composable overlays 2019-12-20 13:39:35 +00:00
Tobias Pflug
54b43703f9 nixpkgs-fmt formatting 2019-12-17 21:16:28 +01:00
Andreas Rammhold
903b4fcd2b fix mkPoetryPython 2019-12-17 14:50:58 +01:00
Andreas Rammhold
5c76155666 add mkPoetryEnv to create poetry python environments 2019-12-17 14:19:32 +01:00
Tobias Pflug
08eb9637aa Remove default values and drop src from mkPoetryPyhon
Drp `poetrylock` and `pyproject` mandatory arguments
without default values and drops `src` from `mkPoetryPyhon`.

Fix test invocations with invalid arguments.
2019-12-17 12:38:34 +01:00
Andreas Rammhold
d8fde74219
split mkPoetryPackage into mkPoetryPython and mkPoetryApplication 2019-12-16 15:03:49 +01:00
Tobias Pflug
84f27ee31d
Refactoring
- Extract utility functions to ./lib.nix
- Extract buildPythonPackage to ./mk-poetry-dep.nix
- Replace some functions with existing builtin functions
- Use lib.partition for python package splitting
- Drop package filtering on the top-level and leave it to pep425.nix
2019-12-16 15:03:49 +01:00
Tobias Pflug
29c93b1dc2
Add wheel file selection according to pep425
Provides a `select` function that picks the most appropriate `.whl` file
based on platform, arch, python version and manylinux/OSX - version.

- Adds unit tests for pep425
- Adds test for manylinux support
- Fixes overrides: `passhtru` must be extended, not overwritten
- Don't strip python packages: this screws up manylinux binaries
2019-12-16 15:02:41 +01:00
zimbatm
1528d54851
handle intreehooks buildsystem
This is necessary for the next version of poetry
2019-12-11 14:13:39 +01:00
zimbatm
310282154c
nixpkgs-fmt: format all the nix code 2019-12-11 13:31:22 +01:00
adisbladis
e194dd6590
Add empty license
poetry.lock does not contain licenses but it's sometimes expected by nixpkgs.
2019-11-27 20:25:05 +00:00