Pipenv: ์ž ๊ธˆ ์ค‘์— ์ƒ์„ฑ๋œ ํ•ด์‹œ๊ฐ€ ์„ค์น˜์™€ ์ผ์น˜ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2018๋…„ 07์›” 08์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: pypa/pipenv

๋ฌธ์ œ ์„ค๋ช…

ํŒจํ‚ค์ง€๋Š” Pipfile( pipenv install )์—์„œ ์„ค์น˜ํ•˜๋Š” ๋ฐ ์‹คํŒจํ–ˆ์ง€๋งŒ ์ด๋ฆ„์„ ์ง€์ •ํ•œ ํ›„ ์„ค์น˜์— ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค.

์˜ˆ์ƒ ๊ฒฐ๊ณผ

ํŒจํ‚ค์ง€๊ฐ€ ์„ค์น˜๋ฉ๋‹ˆ๋‹ค.

์‹ค์ œ ๊ฒฐ๊ณผ

ํ•ด์‹œ๊ฐ€ ์ผ์น˜ํ•˜์ง€ ์•Š์œผ๋ฉด ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. ํŒจํ‚ค์ง€ ์ด๋ฆ„์ด ์ง€์ •๋˜๋ฉด ์„ค์น˜๋˜๊ณ  "์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ์œผ๋ฏ€๋กœ ํ•ด์‹œ๋ฅผ ํ™•์ธํ•˜์ง€ ์•Š๊ณ  ์ด ํŒจํ‚ค์ง€๋ฅผ ์‹ ๋ขฐํ•ฉ๋‹ˆ๋‹ค."๋ผ๊ณ  ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

๋ณต์ œ ๋‹จ๊ณ„

์žฅํ™ฉํ•˜์ง€ ์•Š์€
screenshot 2018-07-09 at 00 46 51
screenshot 2018-07-09 at 00 47 09

์ž์„ธํ•œ ์ถœ๋ ฅ:

>  pipenv install numpy --verbose
Creating a virtualenv for this project...
Pipfile: /home/pi/testing_dir/Pipfile
Using /usr/bin/python3.5m (3.5.3) to create virtualenv...
โ ‹Running virtualenv with interpreter /usr/bin/python3.5m
Using base prefix '/usr'
New python executable in /home/pi/.local/share/virtualenvs/testing_dir-WDGBnYYm/bin/python3.5m
Also creating executable in /home/pi/.local/share/virtualenvs/testing_dir-WDGBnYYm/bin/python
Installing setuptools, pip, wheel...done.
Setting project for testing_dir-WDGBnYYm to /home/pi/testing_dir

Virtualenv location: /home/pi/.local/share/virtualenvs/testing_dir-WDGBnYYm
Installing numpy...
โ ™Installing 'numpy'
$ "/home/pi/.local/share/virtualenvs/testing_dir-WDGBnYYm/bin/pip" install   --verbose    "numpy" -i https://pypi.org/simple --exists-action w
[ snip ]
Installing collected packages: numpy

Successfully installed numpy-1.14.5
Cleaning up...

Adding numpy to Pipfile's [packages]...
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
using sources: [{'name': 'pypi', 'url': 'https://pypi.org/simple', 'verify_ssl': True}]
Using pip: -i https://pypi.org/simple

                          ROUND 1                           
Current constraints:
  numpy (from -r /tmp/pipenv-fw9u0ln7-requirements/pipenv-c8uwffst-constraints.txt (line 2))

Finding the best candidates:
  found candidate numpy==1.14.5 (constraint was <any>)
Finding secondary dependencies:
  numpy==1.14.5             requires numpy==1.14.5; python_version != "3.1.*" and python_version != "3.0.*" and python_version != "3.3.*" and python_version != "3.2.*" and python_version >= "2.7"

New dependencies found in this round:
  adding ['numpy', '==1.14.5', '[]']
Removed dependencies in this round:
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable

                          ROUND 2                           
Current constraints:
  numpy==1.14.5 (from -r /tmp/pipenv-fw9u0ln7-requirements/pipenv-c8uwffst-constraints.txt (line 2))

Finding the best candidates:
  found candidate numpy==1.14.5 (constraint was ==1.14.5)

Finding secondary dependencies:
  numpy==1.14.5             requires numpy==1.14.5; python_version != "3.1.*" and python_version != "3.0.*" and python_version != "3.3.*" and python_version != "3.2.*" and python_version >= "2.7"
------------------------------------------------------------
Result of round 2: stable, done

Updated Pipfile.lock (5a67c1)!
Installing dependencies from Pipfile.lock (5a67c1)...
Installing 'numpy==1.14.5 --hash=sha256:07379fe0b450f6fd6e5934a9bc015025bb4ce1c8fbed3ca8bef29328b1bc9570 [long list of hashes]'
$ "/home/pi/.local/share/virtualenvs/testing_dir-WDGBnYYm/bin/pip" install   --verbose  --no-deps  -r "/tmp/pipenv-m7n5vxhw-requirements/pipenv-s6f0at97-requirement.txt" --require-hashes -i https://pypi.org/simple --exists-action w
Created temporary directory: /tmp/pip-ephem-wheel-cache-ntah_q6a
Created temporary directory: /tmp/pip-install-75w412mp
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: numpy==1.14.5 in /home/pi/.local/share/virtualenvs/testing_dir-WDGBnYYm/lib/python3.5/site-packages (from -r /tmp/pipenv-m7n5vxhw-requirements/pipenv-s6f0at97-requirement.txt (line 1)) (1.14.5)
  Since it is already installed, we are trusting this package without checking its hash. To ensure a completely repeatable environment, install into an empty virtualenv.
Cleaning up...

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

@techalchemy pinwheels ์†Œ์Šค๋ฅผ ์ถ”๊ฐ€ํ•ด๋„ ๋‚ด๊ฐ€ ๊ฒช๊ณ  ์žˆ๋˜ ๊ฒƒ๊ณผ ๋™์ผํ•œ ๋ฌธ์ œ๊ฐ€ ํ•ด๊ฒฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์ถ”๊ฐ€ ์†Œ์Šค๊ฐ€ ํ•„์š”ํ•œ ์ด์œ ์— ๋Œ€ํ•œ ๋ฌธ์„œ๊ฐ€ ์žˆ์Šต๋‹ˆ๊นŒ? pipenv lock ์ฒ˜์Œ ์‹คํ–‰ํ•  ๋•Œ ์ž๋™์œผ๋กœ ํฌํ•จ๋˜์ง€ ์•Š๋Š” ์ด์œ ๊ฐ€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค.

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

๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ฆ‰, x86 ์‹œ์Šคํ…œ์—์„œ ์ž ๊ธˆ ํŒŒ์ผ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์ž ๊ธˆ ํŒŒ์ผ์„ ์–ด๋–ป๊ฒŒ ๊ตฌ์ถ•ํ–ˆ์Šต๋‹ˆ๊นŒ?

๊ท€ํ•˜์˜ ๊ฒฝ์šฐ pipfile์— ์ถ”๊ฐ€ ์†Œ์Šค๋ฅผ ์ถ”๊ฐ€ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

[[source]]
url = "https://pypi.org/simple"
name = "pypi"
verify_ssl = true

[[source]]
url = "https://www.piwheels.org/simole"
name = "piwheels"
verify_ssl = true

[packages]
numpy = {version = "*", index = "piwheels"}

[dev-packages]

[requires]
python_version = "3.5"

๋ฌธ์ œ๊ฐ€ ๊ณ„์†๋˜๋ฉด ๋ฌธ์ œ ํ…œํ”Œ๋ฆฟ์„ ์ž‘์„ฑํ•˜์‹ญ์‹œ์˜ค. ์ž˜๋ชป๋˜๊ณ  ์žˆ๋Š” ๊ฒƒ์„ ๋ฐœ๊ฒฌํ•˜๋Š” ์šฐ๋ฆฌ์˜ ๋Šฅ๋ ฅ์„ ํ•ฉ๋ฆฌํ™”ํ•˜๊ธฐ ์œ„ํ•ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. ๋ณด๊ณ ์„œ์— ๊ฐ์‚ฌ๋“œ๋ฆฌ๋ฉฐ ๋„์›€์ด ๋˜๊ธฐ๋ฅผ ๋ฐ”๋ž๋‹ˆ๋‹ค.

ํด๋”์— ์ž ๊ธˆ ํŒŒ์ผ์ด ์—†์—ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ piwheels ์†Œ์Šค๋ฅผ ์ถ”๊ฐ€ํ•˜๋ฉด ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!

@techalchemy pinwheels ์†Œ์Šค๋ฅผ ์ถ”๊ฐ€ํ•ด๋„ ๋‚ด๊ฐ€ ๊ฒช๊ณ  ์žˆ๋˜ ๊ฒƒ๊ณผ ๋™์ผํ•œ ๋ฌธ์ œ๊ฐ€ ํ•ด๊ฒฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์ถ”๊ฐ€ ์†Œ์Šค๊ฐ€ ํ•„์š”ํ•œ ์ด์œ ์— ๋Œ€ํ•œ ๋ฌธ์„œ๊ฐ€ ์žˆ์Šต๋‹ˆ๊นŒ? pipenv lock ์ฒ˜์Œ ์‹คํ–‰ํ•  ๋•Œ ์ž๋™์œผ๋กœ ํฌํ•จ๋˜์ง€ ์•Š๋Š” ์ด์œ ๊ฐ€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค.

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