mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge branch 'master' into bugfix/vcs-updates
This commit is contained in:
+1
-3
@@ -18,9 +18,7 @@ Pipenv: Python Development Workflow for Humans
|
||||
|
||||
---------------
|
||||
|
||||
**Pipenv** — the tool for managing application dependencies from `PyPA <https://www.pypa.io/en/latest/>`__, free (as in freedom).
|
||||
|
||||
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world. *Windows is a first–class citizen, in our world.*
|
||||
**Pipenv** is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world. *Windows is a first–class citizen, in our world.*
|
||||
|
||||
It automatically creates and manages a virtualenv for your projects, as well as adds/removes packages from your ``Pipfile`` as you install/uninstall packages. It also generates the ever–important ``Pipfile.lock``, which is used to produce deterministic builds.
|
||||
|
||||
|
||||
Vendored
+4
@@ -26,6 +26,10 @@
|
||||
|
||||
<h3>Other Projects</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://pipenv-pipes.readthedocs.io/en/latest/">Pipenv-Pipes</a></li>
|
||||
</ul>
|
||||
|
||||
<p>More <a href="http://kennethreitz.org/">Kenneth Reitz</a> projects:</p>
|
||||
<ul>
|
||||
<li><a href="http://pep8.org/">pep8.org</a></li>
|
||||
|
||||
Vendored
+4
@@ -26,6 +26,10 @@
|
||||
|
||||
<h3>Other Projects</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://pipenv-pipes.readthedocs.io/en/latest/">Pipenv-Pipes</a></li>
|
||||
</ul>
|
||||
|
||||
<p>More <a href="http://kennethreitz.org/">Kenneth Reitz</a> projects:</p>
|
||||
<ul>
|
||||
<li><a href="http://pep8.org/">pep8.org</a></li>
|
||||
|
||||
@@ -119,3 +119,14 @@ instead (not available on Windows).
|
||||
No, it does not, intentionally. Pipfile and setup.py serve different purposes,
|
||||
and should not consider each other by default. See :ref:`pipfile-vs-setuppy`
|
||||
for more information.
|
||||
|
||||
☤ Using ``pipenv run`` in Supervisor program
|
||||
---------------------------------------------
|
||||
|
||||
When you configure a supervisor program's ``command`` with ``pipenv run ...``, you
|
||||
need to set locale enviroment variables properly to make it work.
|
||||
|
||||
Add this line under ``[supervisord]`` section in ``/etc/supervisor/supervisord.conf``::
|
||||
|
||||
[supervisord]
|
||||
environment=LC_ALL='en_US.UTF-8',LANG='en_US.UTF-8'
|
||||
|
||||
+1
-3
@@ -20,9 +20,7 @@ Pipenv: Python Dev Workflow for Humans
|
||||
|
||||
---------------
|
||||
|
||||
**Pipenv** — the tool for managing application dependencies from `PyPA <https://www.pypa.io/en/latest/>`__, free (as in freedom).
|
||||
|
||||
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world. *Windows is a first-class citizen, in our world.*
|
||||
**Pipenv** is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world. *Windows is a first-class citizen, in our world.*
|
||||
|
||||
It automatically creates and manages a virtualenv for your projects, as well as adds/removes packages from your ``Pipfile`` as you install/uninstall packages. It also generates the ever-important ``Pipfile.lock``, which is used to produce deterministic builds.
|
||||
|
||||
|
||||
@@ -206,30 +206,26 @@ class PackageFinder(object):
|
||||
)
|
||||
self.dependency_links.extend(links)
|
||||
|
||||
def get_extras_links(self, links):
|
||||
@staticmethod
|
||||
def get_extras_links(links):
|
||||
requires = []
|
||||
extras = {}
|
||||
|
||||
current_section = None
|
||||
current_list = requires
|
||||
|
||||
for link in links:
|
||||
if not link:
|
||||
current_section = None
|
||||
|
||||
if not current_section:
|
||||
if not (link.startswith('[')):
|
||||
requires.append(link)
|
||||
else:
|
||||
current_section = link[1:-1]
|
||||
extras[current_section] = []
|
||||
current_list = requires
|
||||
if link.startswith('['):
|
||||
current_list = []
|
||||
extras[link[1:-1]] = current_list
|
||||
else:
|
||||
extras[current_section].append(link)
|
||||
current_list.append(link)
|
||||
|
||||
return extras
|
||||
|
||||
|
||||
|
||||
|
||||
@staticmethod
|
||||
def _sort_locations(locations, expand_dir=False):
|
||||
"""
|
||||
|
||||
@@ -1362,29 +1362,29 @@ index f653f6e..48aaa35 100644
|
||||
)
|
||||
self.dependency_links.extend(links)
|
||||
|
||||
+ def get_extras_links(self, links):
|
||||
+ @classmethod
|
||||
+ def get_extras_links(links):
|
||||
+ requires = []
|
||||
+ extras = {}
|
||||
+
|
||||
+ current_section = None
|
||||
+ current_list = requires
|
||||
+
|
||||
+ for link in links:
|
||||
+ if not link:
|
||||
+ current_section = None
|
||||
+
|
||||
+ if not current_section:
|
||||
+ if not (link.startswith('[')):
|
||||
+ requires.append(link)
|
||||
+ else:
|
||||
+ current_section = link[1:-1]
|
||||
+ extras[current_section] = []
|
||||
+ current_list = requires
|
||||
+ if link.startswith('['):
|
||||
+ current_list = []
|
||||
+ extras[link[1:-1]] = current_list
|
||||
+ else:
|
||||
+ extras[current_section].append(link)
|
||||
+ current_list.append(link)
|
||||
+
|
||||
+ return extras
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
@staticmethod
|
||||
def _sort_locations(locations, expand_dir=False):
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
import pytest
|
||||
|
||||
from notpip.index import PackageFinder
|
||||
|
||||
|
||||
get_extras_links_scenarios = {
|
||||
'windows and not windows': (
|
||||
[
|
||||
'chardet',
|
||||
'[:platform_system != "windows"]',
|
||||
'twisted',
|
||||
'[:platform_system == "windows"]',
|
||||
'twisted[windows_platform]',
|
||||
],
|
||||
{
|
||||
':platform_system != "windows"': [
|
||||
'twisted',
|
||||
],
|
||||
':platform_system == "windows"': [
|
||||
'twisted[windows_platform]',
|
||||
],
|
||||
},
|
||||
),
|
||||
'requests': (
|
||||
[
|
||||
'chardet<3.1.0,>=3.0.2',
|
||||
'idna<2.7,>=2.5',
|
||||
'urllib3<1.23,>=1.21.1',
|
||||
'certifi>=2017.4.17',
|
||||
'[security]',
|
||||
'pyOpenSSL>=0.14',
|
||||
'cryptography>=1.3.4',
|
||||
'idna>=2.0.0',
|
||||
'[socks]',
|
||||
'PySocks!=1.5.7,>=1.5.6',
|
||||
(
|
||||
'[socks:sys_platform == "win32"'
|
||||
' and (python_version == "2.7" or python_version == "2.6")]'
|
||||
),
|
||||
'win_inet_pton',
|
||||
],
|
||||
{
|
||||
'security': [
|
||||
'pyOpenSSL>=0.14',
|
||||
'cryptography>=1.3.4',
|
||||
'idna>=2.0.0',
|
||||
],
|
||||
'socks': [
|
||||
'PySocks!=1.5.7,>=1.5.6',
|
||||
],
|
||||
'socks:sys_platform == "win32" '
|
||||
'and (python_version == "2.7" or python_version == "2.6")': [
|
||||
'win_inet_pton',
|
||||
],
|
||||
}
|
||||
),
|
||||
'attrs': (
|
||||
[
|
||||
'[dev]',
|
||||
'coverage',
|
||||
'hypothesis',
|
||||
'pympler',
|
||||
'pytest',
|
||||
'six',
|
||||
'zope.interface',
|
||||
'sphinx',
|
||||
'zope.interface',
|
||||
'[docs]',
|
||||
'sphinx',
|
||||
'zope.interface',
|
||||
'[tests]',
|
||||
'coverage',
|
||||
'hypothesis',
|
||||
'pympler',
|
||||
'pytest',
|
||||
'six',
|
||||
'zope.interface',
|
||||
],
|
||||
{
|
||||
'dev': [
|
||||
'coverage',
|
||||
'hypothesis',
|
||||
'pympler',
|
||||
'pytest',
|
||||
'six',
|
||||
'zope.interface',
|
||||
'sphinx',
|
||||
'zope.interface',
|
||||
],
|
||||
'docs': [
|
||||
'sphinx',
|
||||
'zope.interface',
|
||||
],
|
||||
'tests': [
|
||||
'coverage',
|
||||
'hypothesis',
|
||||
'pympler',
|
||||
'pytest',
|
||||
'six',
|
||||
'zope.interface',
|
||||
],
|
||||
},
|
||||
),
|
||||
'misc': (
|
||||
[
|
||||
'chardet',
|
||||
'[:platform_system != "windows"]',
|
||||
'attrs',
|
||||
'[:platform_system == "windows"]',
|
||||
'pytz',
|
||||
],
|
||||
{
|
||||
':platform_system != "windows"': [
|
||||
'attrs',
|
||||
],
|
||||
':platform_system == "windows"': [
|
||||
'pytz',
|
||||
],
|
||||
},
|
||||
),
|
||||
}
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'scenarios,expected',
|
||||
list(get_extras_links_scenarios.values()),
|
||||
ids=list(get_extras_links_scenarios.keys()),
|
||||
)
|
||||
def test_get_extras_links(scenarios, expected):
|
||||
assert PackageFinder.get_extras_links(scenarios) == expected
|
||||
Reference in New Issue
Block a user