cript0nauta / pynixify

Nix expression generator for Python projects
GNU General Public License v3.0
66 stars 11 forks source link

pynixify.exceptions.NoMatchingVersionFound: json2sql #37

Closed InLaw closed 4 years ago

InLaw commented 4 years ago
/nix/store/r94aa2gj4drkhfvkm2p4ab6cblb6kxlq-python3-3.7.6/lib/python3.7/asyncio/unix_events.py:878: RuntimeWarning: A loop is being detached from a child watcher with pending handlers
  RuntimeWarning)
Traceback (most recent call last):
  File "/nix/store/s7jbqin95y5af68y3jc7qz0lmj3r3wbm-python3.7-pynixify-0.1/lib/python3.7/site-packages/pynixify/version_chooser.py", line 81, in require
    pkg = self._local_packages[canonicalize_name(r.name)]
KeyError: 'json2sql'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/s7jbqin95y5af68y3jc7qz0lmj3r3wbm-python3.7-pynixify-0.1/bin/..pynixify-wrapped-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/s7jbqin95y5af68y3jc7qz0lmj3r3wbm-python3.7-pynixify-0.1/lib/python3.7/site-packages/pynixify/command.py", line 159, in main
    max_jobs=args.max_jobs,
  File "/nix/store/r94aa2gj4drkhfvkm2p4ab6cblb6kxlq-python3-3.7.6/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/nix/store/r94aa2gj4drkhfvkm2p4ab6cblb6kxlq-python3-3.7.6/lib/python3.7/asyncio/base_events.py", line 583, in run_until_complete
    return future.result()
  File "/nix/store/s7jbqin95y5af68y3jc7qz0lmj3r3wbm-python3.7-pynixify-0.1/lib/python3.7/site-packages/pynixify/command.py", line 197, in _main_async
    for req in all_requirements
  File "/nix/store/s7jbqin95y5af68y3jc7qz0lmj3r3wbm-python3.7-pynixify-0.1/lib/python3.7/site-packages/pynixify/version_chooser.py", line 100, in require
    raise NoMatchingVersionFound(str(r))
pynixify.exceptions.NoMatchingVersionFound: json2sql
cript0nauta commented 4 years ago

This looks similar to #34. json2sql only has a pre-release: https://pypi.org/project/json2sql/#history. By design, pre-relases are ignored by default. Could you try using json2sql==1.0.0rc1 as a requirement instead of just json2sql? This will force the usage of a pre-release version.

InLaw commented 4 years ago
Resolving json2sql==1.0.0rc1
Resolving mosql (from PyPIPackage(attr=json2sql, version=1.0.0rc1))
Resolving PyYAML (from PyPIPackage(attr=json2sql, version=1.0.0rc1))
Resolving click (from PyPIPackage(attr=json2sql, version=1.0.0rc1))
Resolving daiquiri (from PyPIPackage(attr=json2sql, version=1.0.0rc1))
Resolving python-json-logger (from PyPIPackage(attr=daiquiri, version=2.1.1))
Resolving setuptools_scm (from PyPIPackage(attr=daiquiri, version=2.1.1))
Error parsing requirements of /nix/store/xbfja0rz21yc8nh6zin5sx1lkkgh10sd-PyYAML-5.3.1.tar.gz. Assuming it has no dependencies.
Resolving setuptools (from NixPackage(attr=setuptools_scm, version=4.1.2))
Error parsing requirements of /nix/store/s3rnwylp3d428whfk88dy51q2mgcahj3-setuptools-46.1.3-sdist.tar.gz. Assuming it has no dependencies.
/nix/store/r94aa2gj4drkhfvkm2p4ab6cblb6kxlq-python3-3.7.6/lib/python3.7/asyncio/unix_events.py:878: RuntimeWarning: A loop is being detached from a child watcher with pending handlers
  RuntimeWarning)
Traceback (most recent call last):
  File "/nix/store/s7jbqin95y5af68y3jc7qz0lmj3r3wbm-python3.7-pynixify-0.1/bin/..pynixify-wrapped-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/s7jbqin95y5af68y3jc7qz0lmj3r3wbm-python3.7-pynixify-0.1/lib/python3.7/site-packages/pynixify/command.py", line 159, in main
    max_jobs=args.max_jobs,
  File "/nix/store/r94aa2gj4drkhfvkm2p4ab6cblb6kxlq-python3-3.7.6/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/nix/store/r94aa2gj4drkhfvkm2p4ab6cblb6kxlq-python3-3.7.6/lib/python3.7/asyncio/base_events.py", line 583, in run_until_complete
    return future.result()
  File "/nix/store/s7jbqin95y5af68y3jc7qz0lmj3r3wbm-python3.7-pynixify-0.1/lib/python3.7/site-packages/pynixify/command.py", line 240, in _main_async
    for package in version_chooser.all_pypi_packages()
  File "/nix/store/s7jbqin95y5af68y3jc7qz0lmj3r3wbm-python3.7-pynixify-0.1/lib/python3.7/site-packages/pynixify/command.py", line 217, in write_package_expression
    meta = await package.metadata()
  File "/nix/store/s7jbqin95y5af68y3jc7qz0lmj3r3wbm-python3.7-pynixify-0.1/lib/python3.7/site-packages/pynixify/base.py", line 77, in metadata
    self.version = Version(version)
  File "/nix/store/0bngdpmsypycaqcgs4jwxvnpzvgw68sn-python3.7-packaging-20.1/lib/python3.7/site-packages/packaging/version.py", line 275, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object
cript0nauta commented 4 years ago

Oops, this bug was a regression introduced in 0db0766774fb50932e265973eae108a95f97df7a. I fixed it in e77dd4990a04173c99fb2098f4df7444fa1b549e and pushed to master. It should work fine now.

Thanks for your contribution!