diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2016-08-30 17:16:13 +0200 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2016-08-30 17:16:49 +0200 |
commit | 850e6287c5c6d84b8f702f129c282da35ed96998 (patch) | |
tree | 6bc376475b2430e66b9bb4c8872461927f549217 /doc/languages-frameworks/python.md | |
parent | e561edc322d275c3687fec431935095cfc717147 (diff) |
Doc: improve python bdist_wheel fix
Diffstat (limited to 'doc/languages-frameworks/python.md')
-rw-r--r-- | doc/languages-frameworks/python.md | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/languages-frameworks/python.md b/doc/languages-frameworks/python.md index e342c24063acc..c38266413bf7e 100644 --- a/doc/languages-frameworks/python.md +++ b/doc/languages-frameworks/python.md @@ -767,21 +767,25 @@ in newpkgs.python27.withPackages (ps: [ps.django_guardian ]) ### `python setup.py bdist_wheel` cannot create .whl -Executing `python setup.py bdist_wheel` fails with +Executing `python setup.py bdist_wheel` in a `nix-shell `fails with ``` ValueError: ZIP does not support timestamps before 1980 ``` This is because files are included that depend on items in the Nix store which have a timestamp of, that is, it corresponds to January the 1st, 1970 at 00:00:00. And as the error informs you, ZIP does not support that. -Fortunately `bdist_wheel` takes into account `SOURCE_DATE_EPOCH`. On Nix this value is set to 1. By setting it to a value correspond to 1980 or later it is possible to build wheels. +The command `bdist_wheel` takes into account `SOURCE_DATE_EPOCH`, and `nix-shell` sets this to 1. By setting it to a value corresponding to 1980 or later, or by unsetting it, it is possible to build wheels. Use 1980 as timestamp: ``` -SOURCE_DATE_EPOCH=315532800 python3 setup.py bdist_wheel +nix-shell --run "SOURCE_DATE_EPOCH=315532800 python3 setup.py bdist_wheel" ``` or the current time: ``` -SOURCE_DATE_EPOCH=$(date +%s) python3 setup.py bdist_wheel +nix-shell --run "SOURCE_DATE_EPOCH=$(date +%s) python3 setup.py bdist_wheel" ``` +or unset: +""" +nix-shell --run "unset SOURCE_DATE_EPOCH; python3 setup.py bdist_wheel" +""" ### `install_data` / `data_files` problems |