inspirehep / inspire-schemas

Inspire JSON schemas and utilities to use them.
GNU General Public License v2.0
8 stars 26 forks source link

inspire-schemas is not installable in a pristine environment #177

Closed jacquerie closed 7 years ago

jacquerie commented 7 years ago

Because of the six import in setup.py one needs to have it installed before installing inspire-schemas. See: https://github.com/inspirehep/inspire-next/pull/2449#issuecomment-309303373

I'm currently working around this by pushing wheels, but I hope there is a better solution...

michamos commented 7 years ago

six is only used in setup.py to provide the next() function, but the next() global seems to exist both in python 2 and python 3 with the same semantics, so I don't know if it is really useful for anything there.

david-caro commented 7 years ago

The six.next is for python<2.6 (that we don't support), so not needed.

david-caro commented 7 years ago

btw. this works for me without any changes...

06:20 PM ~/Work/repos/per_user/inspirehep/hepcrawl<venv:inspire-next>  (master ↓·1|✔) 
dcaro@pcrcssis001$ mktmpenv
New python executable in /home/dcaro/.virtualenvs/tmp-637737eb9880ee2d/bin/python2
Also creating executable in /home/dcaro/.virtualenvs/tmp-637737eb9880ee2d/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /home/dcaro/.virtualenvs/tmp-637737eb9880ee2d/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/dcaro/.virtualenvs/tmp-637737eb9880ee2d/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/dcaro/.virtualenvs/tmp-637737eb9880ee2d/bin/preactivate
virtualenvwrapper.user_scripts creating /home/dcaro/.virtualenvs/tmp-637737eb9880ee2d/bin/postactivate
virtualenvwrapper.user_scripts creating /home/dcaro/.virtualenvs/tmp-637737eb9880ee2d/bin/get_env_details
This is a temporary environment. It will be deleted when you run 'deactivate'.

06:20 PM ~/.virtualenvs/tmp-637737eb9880ee2d<venv:tmp-637737eb9880ee2d> 
dcaro@pcrcssis001$ pip install inspire-schemas
Collecting inspire-schemas
  Downloading inspire_schemas-37.0.1-py2.py3-none-any.whl (50kB)
    100% |████████████████████████████████| 51kB 1.2MB/s 
Collecting autosemver (from inspire-schemas)
Collecting pyyaml (from inspire-schemas)
Collecting idutils (from inspire-schemas)
  Using cached IDUtils-0.2.4-py2.py3-none-any.whl
Collecting jsonschema (from inspire-schemas)
  Using cached jsonschema-2.6.0-py2.py3-none-any.whl
Collecting dulwich (from autosemver->inspire-schemas)
Collecting six>=1.7.2 (from idutils->inspire-schemas)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting isbnid-fork>=0.4.4 (from idutils->inspire-schemas)
Collecting functools32; python_version == "2.7" (from jsonschema->inspire-schemas)
Installing collected packages: dulwich, autosemver, pyyaml, six, isbnid-fork, idutils, functools32, jsonschema, inspire-schemas
Successfully installed autosemver-0.5.1 dulwich-0.17.3 functools32-3.2.3.post2 idutils-0.2.4 inspire-schemas-37.0.1 isbnid-fork-0.5.2 jsonschema-2.6.0 pyyaml-3.12 six-1.10.0

It gets in by idutils.

jacquerie commented 7 years ago

btw. this works for me without any changes...

Note that you're installing my wheel, and not from sources! Here's what I see with inspire-schemas==37.0.0, for which I made no wheel:

~ % mkvirtualenv foo
New python executable in /Users/jacquerie/.virtualenvs/foo/bin/python2.7
Also creating executable in /Users/jacquerie/.virtualenvs/foo/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /Users/jacquerie/.virtualenvs/foo/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/jacquerie/.virtualenvs/foo/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/jacquerie/.virtualenvs/foo/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/jacquerie/.virtualenvs/foo/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/jacquerie/.virtualenvs/foo/bin/get_env_details
(foo) ~ % pip install inspire-schemas==37.0.0
Collecting inspire-schemas==37.0.0
  Downloading inspire-schemas-37.0.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/h1/y43g5n3s3gv6k14kcswnvx440000gn/T/pip-build-r22amQ/inspire-schemas/setup.py", line 31, in <module>
        import six
    ImportError: No module named six

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/h1/y43g5n3s3gv6k14kcswnvx440000gn/T/pip-build-r22amQ/inspire-schemas/
david-caro commented 7 years ago

Ohh... so that's what you meant, that you actually released a wheel packaged version on pypi. okok