nix-community / pypi2nix

Abandoned! Generate Nix expressions for Python packages
194 stars 47 forks source link

Couldn't recognize license in stage 2 #298

Closed furrycatherder closed 5 years ago

furrycatherder commented 5 years ago
Stage2: Extracting metadata from pypi.python.org ...
|-> from websocket_client-0.56.0.dist-info
|-> from webcolors-1.9.1.dist-info
|-> from urllib3-1.25.3.dist-info
|-> from typing_extensions-3.7.4.dist-info
|-> from typing-3.7.4.1.dist-info
|-> from swagger_spec_validator-2.4.3.dist-info
|-> from strict_rfc3339-0.7.dist-info
|-> from six-1.12.0.dist-info
|-> from simplejson-3.16.0.dist-info
|-> from setuptools-41.2.0.dist-info
|-> from selenium-3.141.0.dist-info
|-> from rfc3987-1.3.8.dist-info
|-> from requests-2.22.0.dist-info
|-> from pyzmq-18.1.0.dist-info
|-> from PyYAML-5.1.2.dist-info
|-> from pytz-2019.2.dist-info
|-> from python_dateutil-2.8.0.dist-info
|-> from pyrsistent-0.15.4.dist-info
|-> from PyNaCl-1.3.0.dist-info
|-> from pycparser-2.19.dist-info
|-> from ptyprocess-0.6.0.dist-info
WARNING: Couldn't recognize license `` for `ptyprocess`
|-> from pexpect-4.7.0.dist-info
|-> from paramiko-2.6.0.dist-info
|-> from msgpack_python-0.5.6.dist-info
|-> from monotonic-1.5.dist-info
|-> from MarkupSafe-1.1.1.dist-info
|-> from junitxml-0.7.dist-info
WARNING: Couldn't recognize license `LGPL-3` for `junitxml`
|-> from jsonschema-0.0.0.dist-info
Error: Unable to find release for package jsonschema of version 0.0.0

requirements.txt:

six
requests
bravado
pyzmq
docker
junitxml
selenium
paramiko
pexpect
jinja2
pypi2nix -v -V 2.7 -E libffi -E openssl -r requirements.txt
seppeljordan commented 5 years ago

Hi, thank you for reporting the issue. In case you have not done so, please install the current version of pypi2nix from master on your machine and try again. Many improvements have been made. You can install the current master version of pypi2nix on your machine via

nix-env -if https://github.com/nix-community/pypi2nix/tarball/master
furrycatherder commented 5 years ago

I'm getting a different error about a missing dependency now (argh). There might not be anything y'all can do about this since the dependency, flit, seems to require Python 3. I wonder how pypi2nix was getting past this step before, though:

DEBUG:     Collecting ptyprocess>=0.5
DEBUG:       Downloading https://files.pythonhosted.org/packages/7d/2d/e4b8733cf79b7309d84c9081a4ab558c89d8c89da5961bf4ddb050ca1ce0/ptyprocess-0.6.0.tar.gz (70kB)
DEBUG:       Saved /tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452/download/ptyprocess-0.6.0.tar.gz
DEBUG:       Installing build dependencies: started
DEBUG:       Installing build dependencies: finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /nix/store/6nz66xsx5nmk5dcbf154xfnx6j30qxng-python-2.7.16/bin/python2.7 /nix/store/apirn6z59n6d1m862xb722sj32x10mhd-pypi2nix-bootstrap/base/pip install --ignore-installed --no-user --prefix /run/user/1000/pip-build-env-P7GLyp/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple --find-links file:///tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452/cache/download --find-links file:///nix/store/apirn6z59n6d1m862xb722sj32x10mhd-pypi2nix-bootstrap/index -- flit
       cwd: None
  Complete output (4 lines):
  DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
  Looking in links: file:///tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452/cache/download, file:///nix/store/apirn6z59n6d1m862xb722sj32x10mhd-pypi2nix-bootstrap/index
  ERROR: Could not find a version that satisfies the requirement flit (from versions: none)
  ERROR: No matching distribution found for flit
  ----------------------------------------
ERROR: Command errored out with exit status 1: /nix/store/6nz66xsx5nmk5dcbf154xfnx6j30qxng-python-2.7.16/bin/python2.7 /nix/store/apirn6z59n6d1m862xb722sj32x10mhd-pypi2nix-bootstrap/base/pip install --ignore-installed --no-user --prefix /run/user/1000/pip-build-env-P7GLyp/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple --find-links file:///tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452/cache/download --find-links file:///nix/store/apirn6z59n6d1m862xb722sj32x10mhd-pypi2nix-bootstrap/index -- flit Check the logs for full command output.
seppeljordan commented 5 years ago

Give this a try with master version, it might work.

pypi2nix -v -V 2.7 -E libffi -E openssl -r requirements.txt -s flit

But no guarantees

furrycatherder commented 5 years ago
❯ pypi2nix -v -V 2.7 -E libffi -E openssl -r requirements.txt -s flit
DEBUG: |-> nix-shell --pure /tmp/tmpcxowndg2 --command 'python -c "from platform import python_version; print(python_version())"'
DEBUG:     2.7.16
INFO: pypi2nix v2.0.0
INFO:  running ...
INFO: Stage1: Downloading wheels and creating wheelhouse ...
DEBUG: |-> nix-instantiate --eval --expr 'let pkgs = import <nixpkgs> {}; in ""'
DEBUG:     ""
DEBUG: |-> nix-shell --argstr download_cache_dir /tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452/cache/download --arg extra_build_inputs '[ "libffi" "openssl" ]' --argstr project_dir /tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452 --argstr python_version python27Full --argstr extra_env '' --arg requirements_files '[ "/tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452/768fd80997d4154713c8e22ec1eb2bb2.txt" ]' --argstr destination_directory /tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452/download --argstr editable_sources_directory /tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452/editable_sources --argstr build_directory /tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452/build --pure /nix/store/8q79gjclj6awf4fl4x7dlfgcc38sp2xs-python3.7-pypi2nix-2.0.0/lib/python3.7/site-packages/pypi2nix/pip/download.nix --command exit
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
DEBUG:     Looking in links: file:///tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452/cache/download, file:///nix/store/apirn6z59n6d1m862xb722sj32x10mhd-pypi2nix-bootstrap/index
ERROR: Could not find a version that satisfies the requirement flit (from -r /tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452/768fd80997d4154713c8e22ec1eb2bb2.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for flit (from -r /tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452/768fd80997d4154713c8e22ec1eb2bb2.txt (line 1))
ERROR: Looking in links: file:///tmp/pypi2nix/12fd924a15a80e13d1ed1c98ad9b6452/cache/download, file:///nix/store/apirn6z59n6d1m862xb722sj32x10mhd-pypi2nix-bootstrap/index
Do you want to report above issue (a browser will open with prefilled details of issue)? [y/N]:
Error: While trying to run the command something went wrong.
seppeljordan commented 5 years ago

Okay, it looks to me as if ptyprocess wants to use flit which is not available for python 2 :( I went and checked the source code of ptyprocess and the latest version not requiring flit seems to be 0.5. The I tried the following:

[nix-shell:~/src/pypi2nix/testing]$ pypi2nix -e ptyprocess==0.5 -V 2.7
INFO: pypi2nix v2.0.0
INFO:  running ...
INFO: Stage1: Downloading wheels and creating wheelhouse ...
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
INFO: Stage2: Extracting metadata from pypi.python.org ...
WARNING: Couldn't recognize license `UNKNOWN` for `ptyprocess`
INFO: Stage3: Generating Nix expressions ...
INFO: 
INFO: Nix expressions generated successfully.
INFO: 
INFO: To start development run:
INFO:     nix-shell requirements.nix -A interpreter
INFO: 
INFO: More information you can find at
INFO:     https://github.com/nix-community/pypi2nix

Which seemed to work. So adding ptyprocess==0.5 to your requirements file might work to solve this specific problem.

furrycatherder commented 5 years ago

It completed successfully, thank you. 🙂

seppeljordan commented 5 years ago

I encourage you to open a new issue if you run into additional problems. Thanks again for reporting