Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP 517 support #63

Closed
rth opened this issue May 9, 2020 · 4 comments
Closed

PEP 517 support #63

rth opened this issue May 9, 2020 · 4 comments

Comments

@rth
Copy link
Contributor

rth commented May 9, 2020

Just a question: is PEP517 currently supported?

I see there have been a discussion about it in PyO3/maturin#2 and this repo specify a pyproject.toml, however when I build my project (cf setup.py, pyproject.toml), I get an error,

$ python -m pip install .
[...]
  error: failed to load source for a dependency on `vtext`
  
  Caused by:
    Unable to update /tmp
  
  Caused by:
    failed to read `/tmp/Cargo.toml`
[...]
...
ERROR: Could not build wheels for vtext which use PEP 517 and cannot be installed directly
python -m pip install .
Processing /home/rth/src/vtext/python
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting setuptools-rust>=0.10.2 (from vtext==0.1.0a3)
  Using cached https://files.pythonhosted.org/packages/5b/55/c19472293d7e77cd9b436dae17e4ff755545c0442b5af9e7929f277a637b/setuptools_rust-0.10.6-py3-none-any.whl
Collecting numpy>=1.15.0 (from vtext==0.1.0a3)
  Using cached https://files.pythonhosted.org/packages/1f/df/7988fbbdc8c9b8efb575029498ad84b77e023a3e4623e85068823a102b1d/numpy-1.18.4-cp37-cp37m-manylinux1_x86_64.whl
Collecting scipy>=1.1.0 (from vtext==0.1.0a3)
  Using cached https://files.pythonhosted.org/packages/dd/82/c1fe128f3526b128cfd185580ba40d01371c5d299fcf7f77968e22dfcc2e/scipy-1.4.1-cp37-cp37m-manylinux1_x86_64.whl
Requirement already satisfied: setuptools in /home/rth/miniconda3/envs/rust-env/lib/python3.7/site-packages (from vtext==0.1.0a3) (41.2.0)
Collecting toml>=0.9.0 (from setuptools-rust>=0.10.2->vtext==0.1.0a3)
  Using cached https://files.pythonhosted.org/packages/a2/12/ced7105d2de62fa7c8fb5fce92cc4ce66b57c95fb875e9318dba7f8c5db0/toml-0.10.0-py2.py3-none-any.whl
Collecting semantic-version>=2.6.0 (from setuptools-rust>=0.10.2->vtext==0.1.0a3)
  Using cached https://files.pythonhosted.org/packages/a5/15/00ef3b7888a10363b7c402350eda3acf395ff05bebae312d1296e528516a/semantic_version-2.8.5-py2.py3-none-any.whl
Building wheels for collected packages: vtext
  Building wheel for vtext (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/rth/miniconda3/envs/rust-env/bin/python /home/rth/miniconda3/envs/rust-env/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpnf1rtlow
       cwd: /tmp/pip-req-build-tv9xeim2
  Complete output (86 lines):
  running bdist_wheel
  running build
  running build_py
  creating build/lib
  creating build/lib/vtext
  copying vtext/__init__.py -> build/lib/vtext
  copying vtext/stem.py -> build/lib/vtext
  copying vtext/vectorize.py -> build/lib/vtext
  copying vtext/tokenize.py -> build/lib/vtext
  creating build/lib/vtext/metrics
  copying vtext/metrics/__init__.py -> build/lib/vtext/metrics
  copying vtext/metrics/string.py -> build/lib/vtext/metrics
  creating build/lib/vtext/tests
  copying vtext/tests/__init__.py -> build/lib/vtext/tests
  copying vtext/tests/test_metrics.py -> build/lib/vtext/tests
  copying vtext/tests/test_stem.py -> build/lib/vtext/tests
  copying vtext/tests/test_vectorize.py -> build/lib/vtext/tests
  copying vtext/tests/test_tokenize.py -> build/lib/vtext/tests
  running egg_info
  writing vtext.egg-info/PKG-INFO
  writing dependency_links to vtext.egg-info/dependency_links.txt
  writing requirements to vtext.egg-info/requires.txt
  writing top-level names to vtext.egg-info/top_level.txt
  reading manifest file 'vtext.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'vtext.egg-info/SOURCES.txt'
  running build_ext
  running build_rust
  error: failed to load source for a dependency on `vtext`
  
  Caused by:
    Unable to update /tmp
  
  Caused by:
    failed to read `/tmp/Cargo.toml`
  
  Caused by:
    No such file or directory (os error 2)
  Traceback (most recent call last):
    File "/home/rth/miniconda3/envs/rust-env/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
      main()
    File "/home/rth/miniconda3/envs/rust-env/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/rth/miniconda3/envs/rust-env/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 141, in build_wheel
      metadata_directory)
    File "/tmp/pip-build-env-i0ssb0jt/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 213, in build_wheel
      wheel_directory, config_settings)
    File "/tmp/pip-build-env-i0ssb0jt/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 198, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-i0ssb0jt/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 250, in run_setup
      self).run_setup(setup_script=setup_script)
    File "/tmp/pip-build-env-i0ssb0jt/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 143, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 28, in <module>
      packages=find_packages(),
    File "/tmp/pip-build-env-i0ssb0jt/overlay/lib/python3.7/site-packages/setuptools/__init__.py", line 144, in setup
      return distutils.core.setup(**attrs)
    File "/home/rth/miniconda3/envs/rust-env/lib/python3.7/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/home/rth/miniconda3/envs/rust-env/lib/python3.7/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/home/rth/miniconda3/envs/rust-env/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-i0ssb0jt/overlay/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "/home/rth/miniconda3/envs/rust-env/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/home/rth/miniconda3/envs/rust-env/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/home/rth/miniconda3/envs/rust-env/lib/python3.7/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/home/rth/miniconda3/envs/rust-env/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/home/rth/miniconda3/envs/rust-env/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-i0ssb0jt/overlay/lib/python3.7/site-packages/setuptools_rust/build_ext.py", line 26, in run
      build_rust.run()
    File "/tmp/pip-build-env-i0ssb0jt/overlay/lib/python3.7/site-packages/setuptools_rust/build.py", line 313, in run
      self.build_extension(ext)
    File "/tmp/pip-build-env-i0ssb0jt/overlay/lib/python3.7/site-packages/setuptools_rust/build.py", line 95, in build_extension
      metadata = json.loads(check_output(metadata_command).decode("utf-8"))
    File "/home/rth/miniconda3/envs/rust-env/lib/python3.7/subprocess.py", line 395, in check_output
      **kwargs).stdout
    File "/home/rth/miniconda3/envs/rust-env/lib/python3.7/subprocess.py", line 487, in run
      output=stdout, stderr=stderr)
  subprocess.CalledProcessError: Command '['cargo', 'metadata', '--manifest-path', 'Cargo.toml', '--format-version', '1']' returned non-zero exit status 101.
  ----------------------------------------
  ERROR: Failed building wheel for vtext
  Running setup.py clean for vtext
Failed to build vtext
ERROR: Could not build wheels for vtext which use PEP 517 and cannot be installed directly

while at the same time for me python setup.py install and bdist_wheel works fine.

Am I doing something wrong or is it simply not yet supported?

@konstin
Copy link
Member

konstin commented May 9, 2020

I just tried pip install . on vtext and with the latest pip and setuptools and it worked. In general setuptools-rust should be as PEP 517 compliant as setuptools.

@rth
Copy link
Contributor Author

rth commented May 9, 2020

Thanks for the confirmation. Interesting, I was getting the above error both locally and in CI (https://circleci.com/gh/rth/vtext/1383). Anyway the issue seems to be on my end, closing. Thanks again!

@rth rth closed this as completed May 9, 2020
@konstin
Copy link
Member

konstin commented May 9, 2020

WARNING: You are using pip version 20.0.2; however, version 20.1 is available.

You need to upgrade pip, since pip 20.0.2 is still doing out-of-tree builds which don't work as the cargo part isn't copied, while 20.1 does in-place build which work.

@rth
Copy link
Contributor Author

rth commented May 9, 2020

Ahh, makes sense thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants