<p>pip๋Š” pyproject.toml์˜ [build-system]์—์„œ ํŒŒ์ผ ๊ฒฝ๋กœ๋กœ ํ•„์š”ํ•œ PEP 508 URL์„ ๊ตฌ๋ฌธ ๋ถ„์„ํ•˜๋ ค๊ณ ํ•ฉ๋‹ˆ๋‹ค.</p>

์— ๋งŒ๋“  2019๋…„ 04์›” 13์ผ  ยท  5์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: pypa/pip

ํ™˜๊ฒฝ

  • pip ๋ฒ„์ „ : tox๋Š” ๋‚˜์—๊ฒŒ ๋งํ•˜์ง€ ์•Š๋Š”๋‹ค : ๋‘๋ ค์šด :
  • Python ๋ฒ„์ „ : 3.7
  • ์šด์˜์ฒด์ œ : Fedora GNU / Linux

๊ธฐ์ˆ 
๋‹ค์Œ์€ "wobblui @ https://github.com/wobblui/wobblui/archive/master.zip "์„ ์ง€์ •ํ•˜๋ ค๊ณ  ํ•  ๋•Œ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

  Requirement 'wobblui @ https://github.com/wobblui/wobblui/archive/master.zip' looks like a filename, but the file does not exist
  Processing ./wobblui @ https:/github.com/wobblui/wobblui/archive/master.zip
  Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/home/jonas/Develop/myproj/wobblui @ https:/github.com/wobblui/wobblui/archive/master.zip'

์˜ˆ์ƒ๋˜๋Š” ํ–‰๋™
seutp_requires ์—์„œ๋„ ์ž‘๋™ํ•˜๊ณ  ์ด๊ฒƒ์ด ๊ถŒ์žฅ๋˜๋Š” ๋Œ€์ฒดํ’ˆ์ด๊ธฐ ๋•Œ๋ฌธ์— ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. ๋งž์Šต๋‹ˆ๊นŒ?

์žฌํ˜„ ๋ฐฉ๋ฒ•
์ด pyproject.toml์„ ์‚ฌ์šฉํ•˜์‹ญ์‹œ์˜ค.

[build-system]
requires = ["setuptools", "wheel", "wobblui @ https://github.com/wobblui/wobblui/archive/master.zip"]
build-backend = "setuptools.build_meta"

์‚ฐ์ถœ

  Requirement 'wobblui @ https://github.com/wobblui/wobblui/archive/master.zip' looks like a filename, but the file does not exist
  Processing ./wobblui @ https:/github.com/wobblui/wobblui/archive/master.zip
  Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/home/jonas/Develop/myproj/wobblui @ https:/github.com/wobblui/wobblui/archive/master.zip'
duplicate auto-locked awaiting response bug

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

๊ทธ๋งŒํ•œ ๊ฐ€์น˜๋ฅผ ์œ„ํ•ด, ํ•ด๋‹น ๋ฌธ์ œ์™€ ๊ด€๋ จ๋œ PR (# 6203)์˜ pip๋Š” ์—ฌ๊ธฐ์— ์ œ๊ณต๋œ pyproject.toml ๋ฅผ ๋ฌธ์ œ์—†์ด ์„ค์น˜ํ•  ์ˆ˜์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

๋ชจ๋“  5 ๋Œ“๊ธ€

๋‚˜๋Š” ์ด๊ฒƒ์ด # 6202์˜ ์ค‘๋ณต์ด๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๊นŒ?

ํ  ๊ทธ ์‚ฌ๋žŒ์€ requirements.txt ๋ฅผ ์–ธ๊ธ‰ํ•˜๋Š” ๊ฒƒ ๊ฐ™๊ณ  ๋‚ด๋ถ€์ ์œผ๋กœ ๋™์ผํ•œ ๋ฉ”์ปค๋‹ˆ์ฆ˜์„ ์‚ฌ์šฉํ•˜๋Š”์ง€ ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค. ๋™์ผํ•œ ๊ฒƒ์„ ์‚ฌ์šฉํ•œ๋‹ค๋ฉด ์•„๋งˆ๋„ ์ค‘๋ณต ์ผ ๊ฒƒ์ž…๋‹ˆ๋‹ค : +1 :

๋‚˜๋Š” ๊ทธ๊ฒƒ์ด ๋™์ผํ•œ ๋ฉ”์ปค๋‹ˆ์ฆ˜์„ ์‚ฌ์šฉํ•œ๋‹ค๊ณ  ํ™•์‹ ํ•˜์ง€๋งŒ, ๊ทธ๊ฒƒ์ด ๊ณ ์ณ์งˆ ๋•Œ๊นŒ์ง€ ์ด๊ฒƒ์„ ์—ด์–ด ๋‘๋Š” ๊ฒƒ์ด ์•„ํ”„์ง€ ์•Š์„ ๊ฒƒ์ด๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

๊ทธ๋งŒํ•œ ๊ฐ€์น˜๋ฅผ ์œ„ํ•ด, ํ•ด๋‹น ๋ฌธ์ œ์™€ ๊ด€๋ จ๋œ PR (# 6203)์˜ pip๋Š” ์—ฌ๊ธฐ์— ์ œ๊ณต๋œ pyproject.toml ๋ฅผ ๋ฌธ์ œ์—†์ด ์„ค์น˜ํ•  ์ˆ˜์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

6203์ด ๋ณ‘ํ•ฉ๋˜์—ˆ๊ณ  ๋งˆ์Šคํ„ฐ์— ๋Œ€ํ•œ ์ˆ˜์ • ์‚ฌํ•ญ์„ ํ™•์ธํ•  ์ˆ˜์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.


fixed.sh

#!/bin/sh
cd "$(mktemp -d)"
python -m venv .venv
. .venv/bin/activate

set -ex
pip install --upgrade git+https://github.com/pypa/pip.git
cat <<EOF > pyproject.toml
[build-system]
requires = ["setuptools", "wheel", "wobblui @ https://github.com/wobblui/wobblui/archive/master.zip"]
build-backend = "setuptools.build_meta"
EOF
echo "from setuptools import setup; setup(name='hello')" > setup.py
pip install .


์‚ฐ์ถœ

+ pip install --upgrade git+https://github.com/pypa/pip.git
Collecting git+https://github.com/pypa/pip.git
  Cloning https://github.com/pypa/pip.git to /tmp/user/1000/pip-req-build-vj85ywtn
  Installing build dependencies ... done
Installing collected packages: pip
  Found existing installation: pip 18.1
    Uninstalling pip-18.1:
      Successfully uninstalled pip-18.1
  Running setup.py install for pip ... done
Successfully installed pip-19.3.dev0
+ cat
+ echo from setuptools import setup; setup(name='hello')
+ pip install .
Processing /tmp/user/1000/tmp.xAtiVhhzb7
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: hello
  Building wheel for hello (PEP 517) ... done
  Created wheel for hello: filename=hello-0.0.0-cp37-none-any.whl size=971 sha256=777a97a967e962ad9ae4d085b5eb369b8ead6340b4c1faae4cc42707a170bd1b
  Stored in directory: /tmp/user/1000/pip-ephem-wheel-cache-rvibo0ng/wheels/15/31/64/f6d8e3210b2f9a59fb104fc18d2651440f5e6d328adeca6341
Successfully built hello
Installing collected packages: hello
Successfully installed hello-0.0.0

์ด ๋ฌธ์ œ๋ฅผ ์ค‘๋ณต์œผ๋กœ ์ข…๋ฃŒํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ์ ์ด ์žˆ์œผ๋ฉด ์•Œ๋ ค์ฃผ์„ธ์š”!

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰