pip-api icon indicating copy to clipboard operation
pip-api copied to clipboard

pyproject: port build to pyproject.toml

Open woodruffw opened this issue 3 years ago • 7 comments

WIP.

Signed-off-by: William Woodruff [email protected]

woodruffw avatar Jul 26 '22 15:07 woodruffw

Hmm, so since we're currently testing against some very old pip versions we might not be ready to adopt this.

di avatar Jul 26 '22 15:07 di

Yeah...I was thinking we could maybe pre-build the sdist or wheel using python -m build and then downgrade the environment to the appropriate version of pip to test with, but I'm not familiar enough with tox to know how to do that off the top of my head.

woodruffw avatar Jul 26 '22 15:07 woodruffw

Separately, I'm not sure I understand the current CI failure:

ERROR: invocation failed (exit code 1), logfile: /home/runner/work/pip-api/pip-api/.tox/py37-pip1921/log/py37-pip1921-2.log
================================== log start ===================================
ERROR: File "setup.py" not found. Directory cannot be installed in editable mode: /home/runner/work/pip-api/pip-api
(A "pyproject.toml" file was found, but editable mode currently requires a setup.py based build.)
WARNING: You are using pip version 19.2.1, however version 22.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

=================================== log end ====================================
___________________________________ summary ____________________________________
ERROR:   py37-pip[19](https://github.com/di/pip-api/runs/7523371831?check_suite_focus=true#step:5:20)21: InvocationError for command /home/runner/work/pip-api/pip-api/.tox/py37-pip1921/bin/python -m pip install --exists-action w -e . (exited with code 1)

(I don't see an invocation that forces editable installs anywhere in tox.ini, but that might again be because I don't understand it too well.)

woodruffw avatar Jul 26 '22 15:07 woodruffw

I think it's this: https://github.com/di/pip-api/blob/master/tox.ini#L10

di avatar Jul 26 '22 15:07 di

Alright, now it fails due to the ancient pips, as expected:

Processing ./.tox/.tmp/package/1/pip_api-0.0.30.tar.gz
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/tokenize.py", line 447, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-y74h3gsq/setup.py'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-y74h3gsq/
You are using pip version [18](https://github.com/di/pip-api/runs/7524008455?check_suite_focus=true#step:5:19).1, however version [22](https://github.com/di/pip-api/runs/7524008455?check_suite_focus=true#step:5:23).2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

woodruffw avatar Jul 26 '22 15:07 woodruffw

(Another missing thing: we need to embed everything that's currently specified via MANIFEST.in, since pyproject.toml-based builds don't respect that file.)

woodruffw avatar Jul 26 '22 15:07 woodruffw

Might be good to figure out at which point we can drop support for the ancient pip versions (i.e., when we only support Python versions that they predate). But given the relative newness of pyproject.toml support, this might be a long while.

di avatar Oct 25 '22 20:10 di

Thanks for following through on this!

di avatar Aug 07 '24 16:08 di