ratt-ru / packratt

BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Fails to install in development mode #20

Closed landmanbester closed 3 years ago

landmanbester commented 3 years ago

Not sure what's happening here but I can't seem to pip install with -e. I've tried this in python 3.6 and 3.7. Bails with

Running setup.py develop for packratt
    ERROR: Command errored out with exit status 1:
     command: /home/landman/venvs/pkrat/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/landman/Projects/packratt/setup.py'"'"'; __file__='"'"'/home/landman/Projects/packratt/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: /home/landman/Projects/packratt/
    Complete output (3 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ModuleNotFoundError: No module named 'setuptools'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/landman/venvs/pkrat/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/landman/Projects/packratt/setup.py'"'"'; __file__='"'"'/home/landman/Projects/packratt/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

but setuptools is installed and at the latest version

(pkrat) LAPTOP-ED4N50Q2 :: ~/Projects » python                                                                                                                                1 ↵
Python 3.6.9 (default, Jan 26 2021, 15:33:00) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> setuptools.__version__
'57.0.0'

Any ideas?

sjperkins commented 3 years ago

packratt's packaging and dependencies are managed by poetry so technically it isn't using setuptools.

Adding "setuptools" to https://github.com/ratt-ru/packratt/blob/master/pyproject.toml#L28 supports what you want to do, but that'd be a hybrid poetry/setuptools package management scheme.

pip install now creates a pristine environment with all the build dependencies specified in pyproject.toml.

Poetry does seem to support an editable mode now: https://github.com/python-poetry/poetry/pull/3940

It may be simpler to just temporarily add setuptools to "requires" in pyproject.toml

landmanbester commented 3 years ago

Thanks, I managed. Do you want to close this one or keep it open?