Игорь Шевченко, Antida software
pip install django
pip install requests
pip freeze > requirements.txt
certifi==2017.7.27.1
chardet==3.0.4
Django==1.11.4
idna==2.6
pytz==2017.2
requests==2.18.4
urllib3==1.22
pip install -r requirements.txt
pip uninstall requests
npm install jquery --save
pip install celery
pip freeze | grep celery >> requirements.txt
virtualenv
certifi==2017.7.27.1
chardet==3.0.4
Django==1.11.4
idna==2.6
pytz==2017.2
requests==2.18.4
urllib3==1.22
django==1.11
requests
Два файла: requirements.txt и requirements.lock.txt
npm install jquery --save
npm install grunt --save-dev
npm install
npm install --production
Два файла: requirements.txt и dev-requirements.txt
-r requirements.txt
pytest==3.2.3
Всё сложно.
https://tech.knewton.com/blog/2015/09/the-nine-circles-of-python-dependency-hell/
pip install djanngo
Недавно был инцидент с пакетами, ворующими секретные токены
Хорошие ребята сами занимают похожие имена
[[source]]
url = 'https://pypi.python.org/simple'
verify_ssl = true
[requires]
python_version = '3.6'
[packages]
requests = { extras = ['socks'] }
Django = '>1.10'
[dev-packages]
pytest = '*'
[[source]]
url = 'https://pypi.python.org/simple'
verify_ssl = true
[requires]
python_version = '3.6'
[packages]
requests = { extras = ['socks'] }
Django = '>1.10'
[dev-packages]
pytest = '*'
{
"_meta": {
"hash": {
"sha256": "73d81f4fbe42d1da158c5d4435d9...",
},
"requires": [
{"marker": "python_version", "specifier": "3.6"}
],
"sources": [
{"url": "https://pypi.python.org/simple", "verify_ssl": true},
]
},
"default": [
{"name": "Django", "version": "1.10.3", "hash": "..."},
{"name": "requests", "version": "2.12.1", "hash": "..."},
{"name": "PySocks", "version": "1.5.6", "hash": "..."},
],
"development": [
{"name": "pytest", "version": "3.2.3", "hash": "..."},
]
}
{
"_meta": {
"hash": {
"sha256": "73d81f4fbe42d1da158c5d4435d9...",
},
"requires": [
{"marker": "python_version", "specifier": "3.6"}
],
"sources": [
{"url": "https://pypi.python.org/simple", "verify_ssl": true},
]
},
"default": [
{"name": "Django", "version": "1.10.3", "hash": "..."},
{"name": "requests", "version": "2.12.1", "hash": "..."},
{"name": "PySocks", "version": "1.5.6", "hash": "..."},
],
"development": [
{"name": "pytest", "version": "3.2.3", "hash": "..."},
]
}
pipenv = pip + Pipfile + virtualenv
pip install pipenv
cd my_project
pipenv install
pipenv install django
pipenv install pytest --dev
pipenv lock
pipenv uninstall django
pipenv install
pipenv shell
pipenv run python my_project.py
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
[packages]
idna = "==2.7"
requests = "*"
pipenv install
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
CRITICAL:pip.index:Could not find a version that satisfies the requirement
idna==2.7 (from versions: 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 2.0
2.1, 2.2, 2.3, 2.4, 2.5, 2.6)
Warning: Your dependencies could not be resolved. You likely have a mismatch in
your sub-dependencies. You can use $ pipenv install --skip-lock to bypass
this mechanism, then run $ pipenv graph to inspect the situation.
pipenv install djanngo
Did you mean django? [Y/n]:
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
[packages]
requests = "*"
pywinusb = {version = "*", os_name = "== 'windows'"}
[packages]
unittest2 = {version = ">=1.0,<3.0", markers="""\
python_version < '2.7.9' or \
(python_version >= '3.0' and python_version < '3.4') \
"""}
pipenv open requests
Opening 'C:\\Users\\igor\\.virtualenvs\\pipenv-I9XgK3SA
\\lib\\site-packages\\requests' in your EDITOR.
Слайды: https://igor-shevchenko.github.io/python-deps-2017
Почта: mail@igorshevchenko.ru
Твиттер: @igorshevchenko_
Created by Gan Khoon Lay from the Noun Project