rdemaria / pytimber

Python Wrapping of CALS API
12 stars 23 forks source link

Add a pyproject.toml to document the setup.py dependencies #70

Closed pelson closed 4 years ago

pelson commented 5 years ago

This will ensure that cmmnbuild-dep-manager is installed before setup.py is run.

Ref: https://www.python.org/dev/peps/pep-0518/#rationale

pelson commented 5 years ago

Just a quick note: This does not fix python setup.py bdist_wheel (which will fail). It simply means that if you pip install pytimber you will get a build environment with the necessary dependencies.

For me, this means that I can pip install something that depends on pytimber/pyjapc, and although I get an initial error message in the output, the installation runs to completion (and installs the necessary package). An example log output (for pyjapc, not pytimber, but the result is the same):

$ pip install acc-py
...
Requirement already satisfied: JPype1==0.6.3 in ./env_clean/lib/python3.6/site-packages (from acc-py) (0.6.3)
Collecting pyjapc==2.0.6 (from acc-py)
releases/packages/pyjapc/2.0.6/pyjapc-2.0.6.tar.gz
...
Collecting cmmnbuild-dep-manager==2.2.4 (from acc-py)
...
Building wheels for collected packages: pyjapc
  Building wheel for pyjapc (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/pelson/gitlab/scripting-tools/pyjapc/env_clean/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9zb_n_uq/pyjapc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9zb_n_uq/pyjapc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-381n3mxv --python-tag cp36
       cwd: /tmp/pip-install-9zb_n_uq/pyjapc/
  Complete output (32 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/pyjapc
  copying pyjapc/rbac_dialog.py -> build/lib/pyjapc
  copying pyjapc/pyjapc.py -> build/lib/pyjapc
  copying pyjapc/__init__.py -> build/lib/pyjapc
  installing to build/bdist.linux-x86_64/wheel
  running install
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-9zb_n_uq/pyjapc/setup.py", line 129, in <module>
      'deploy_sphinx': deploy_sphinx
    File "/home/pelson/gitlab/scripting-tools/pyjapc/env_clean/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/home/pelson/gitlab/scripting-tools/pyjapc/env_clean/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/home/pelson/gitlab/scripting-tools/pyjapc/env_clean/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/home/pelson/gitlab/scripting-tools/pyjapc/env_clean/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/home/pelson/gitlab/scripting-tools/pyjapc/env_clean/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 228, in run
      self.run_command('install')
    File "/home/pelson/gitlab/scripting-tools/pyjapc/env_clean/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/home/pelson/gitlab/scripting-tools/pyjapc/env_clean/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-9zb_n_uq/pyjapc/setup.py", line 35, in run
      mgr = cmmnbuild_dep_manager.Manager()
  AttributeError: module 'cmmnbuild_dep_manager' has no attribute 'Manager'
  ----------------------------------------
  ERROR: Failed building wheel for pyjapc
  Running setup.py clean for pyjapc
Failed to build pyjapc
Installing collected packages: cmmnbuild-dep-manager, pyjapc
  Running setup.py install for pyjapc ... done
Successfully installed cmmnbuild-dep-manager-2.2.4 pyjapc-2.0.6