Commit graph

30 commits

Author SHA1 Message Date
Andreas Rammhold
cd693810c3
Always fallback to the Pypi API when fetching sources & wheels
Previously we randomly encountered issues where the Pypi mirror URLs
wouldn't be correct with packages whos first character is frequently
written in upper case (e.g. SqlAlchemy, MarkupSafe, ...). The Pypi
mirrors are aparently not consistent in the naming of the file locations
which lead to random errors after package version bumps.

By falling back to the API lookup (that we already did for wheels) we
can workaround that situation.
2021-05-13 21:48:03 +02:00
adisbladis
36f46f7696
Incorporate string escaping changes from nixpkgs #108086 2021-03-04 14:11:52 +02:00
K900
324cc0cb2a Fix stdenv.platform accesses for latest nixpkgs
This fixes builds being completely broken after:
* https://github.com/NixOS/nixpkgs/pull/110726
* https://github.com/NixOS/nixpkgs/pull/110544

This also fixes poetry2nix on ARM and PowerPC platforms by introducing a
mapping from Nixpkgs targets to manylinux_* machine names and using it
when matching wheels for dependencies.
2021-01-30 20:17:54 +03:00
adisbladis
52a484be33
Reformat with nixpkgs-fmt 1.0.0 2020-10-01 19:08:57 +02:00
adisbladis
3de03cdddc
Use build-system selection from requires field 2020-10-01 18:21:00 +02:00
Silvan Mosberger
b3014009e9
throw an error when no build-backend is specified
If a project doesn't have this specified, poetry doesn't do its thing,
leading to package metadata not being detected (UNKNOWN packages)
2020-07-14 23:09:10 +02:00
adisbladis
db06bdd6e7
Format with nixpkgs-fmt 0.9 2020-05-19 21:06:02 +01:00
adisbladis
c5acd18a59
fetchWheelFromPypi: Map closer to nixpkgs fetchurl 2020-05-03 10:10:19 +01:00
Raito Bezarius
330b56105c
fetchwheel: initial version 2020-05-03 10:10:09 +01:00
adisbladis
4ebbfdacd1
nixpkgs-fmt broke it's format yet again 2020-04-29 14:12:59 +01:00
adisbladis
e164fdd78a
Fix semver pythonVersion checks
We're only looking at the major.minor currently. We need to look
major.minor.patch instead.

This is made slighty problematic non-cpython where the patch version
doesn't match. If major.minor is the same for both the Python version
& the derivation version we default to derivation.version otherwise we
set the pythonVersion to pythonVersion major.minor.0.
2020-04-29 13:22:20 +01:00
adisbladis
9dfb080d3f
Add canonicalisation of module names
This shouldn't be required and I think that these are actually
packaging bugs and not something that poetry2nix should really be
concerned with.

Closes #84
2020-04-15 10:24:46 +01:00
adisbladis
b16cfe598b
lib: Minor nixpkgs-fmt 2020-04-14 13:07:15 +01:00
adisbladis
a7a882f88f
Set default build system to empty string
In case a build-system is not set.

Closes #83
2020-04-14 11:42:16 +01:00
adisbladis
f7e435407e
nixpkgs-fmt all the things (again...) 2020-03-14 23:13:51 +00:00
adisbladis
a7fec487f8
Prevent infinite recursion in gitignore filter construction 2020-03-01 08:45:52 +00:00
adisbladis
b81a94878f
nixpkgs-fmt lib.nix 2020-02-29 21:27:38 +00:00
adisbladis
924746ff9a
Make gitignore recursive 2020-02-29 21:22:34 +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
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
8591164784
Add overrides to build pyqt5
Extra functionality exposed in nixpkgs needs further overrides.
2020-01-13 00:27:14 +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
0d5719df26
Add IFD based fallback for fromTOML 2020-01-11 23:33:40 +00:00
adisbladis
f394798d72
Add full operator support 2020-01-09 12:48:07 +00:00
adisbladis
03d439fed3
Remove hard-coded known build systems
We can attempt to dynamically fetch this from the python package set instead.
2020-01-02 18:27:01 +00:00
adisbladis
4acf604723
Add support for local path dependencies 2019-12-29 13:20:35 +00:00
Andreas Rammhold
5741d9e59e
nixpkgs-fmt all the things 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