Merge branch 'master' into dev_safety-db

This commit is contained in:
Dan Ryan
2020-04-25 02:42:26 -04:00
committed by GitHub
1090 changed files with 97842 additions and 33524 deletions
-21
View File
@@ -1,21 +0,0 @@
jobs:
- job:
displayName: Docs
pool:
vmImage: ubuntu-16.04
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
- template: steps/install-dependencies.yml
- bash: tox -e docs
displayName: Build docs
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: docs'
inputs:
pathToPublish: docs/build
artifactName: docs
@@ -1,15 +0,0 @@
steps:
- task: UsePythonVersion@0
displayName: Use Python $(python.version)
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'
- template: ../steps/install-dependencies.yml
- bash: |
export GIT_SSL_CAINFO=$(python -m certifi)
export LANG=C.UTF-8
python -m pip install --upgrade setuptools twine readme_renderer[md]
python setup.py sdist
twine check dist/*
@@ -1,12 +0,0 @@
steps:
- task: UsePythonVersion@0
displayName: Use Python $(python.version)
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'
- template: ../steps/install-dependencies.yml
- template: ../steps/create-virtualenv.yml
- template: ../steps/run-tests.yml
-38
View File
@@ -1,38 +0,0 @@
steps:
- task: UsePythonVersion@0
displayName: Use Python $(python.version)
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'
- template: ../steps/install-dependencies.yml
- bash: |
mkdir -p "$AGENT_HOMEDIRECTORY/.virtualenvs"
mkdir -p "$WORKON_HOME"
pip install certifi
export GIT_SSL_CAINFO="$(python -m certifi)"
export LANG="C.UTF-8"
export PIP_PROCESS_DEPENDENCY_LINKS="1"
echo "Path $PATH"
echo "Installing Pipenv…"
pip install -e "$(pwd)" --upgrade
pipenv install --deploy --dev
echo pipenv --venv && echo pipenv --py && echo pipenv run python --version
displayName: Make Virtualenv
- script: |
# Fix Git SSL errors
export GIT_SSL_CAINFO="$(python -m certifi)"
export LANG="C.UTF-8"
export PIP_PROCESS_DEPENDENCY_LINKS="1"
git submodule sync && git submodule update --init --recursive
pipenv run pytest --junitxml=test-results.xml
displayName: Run integration tests
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
@@ -1,39 +0,0 @@
parameters:
vmImage:
jobs:
- job: Vendor_Scripts
displayName: Test Vendor Scripts
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
maxParallel: 4
matrix:
${{ if eq(parameters.vmImage, 'vs2017-win2016') }}:
# TODO remove once vs2017-win2016 has Python 3.7
Python37:
python.version: '>= 3.7.0-b2'
python.architecture: x64
${{ if ne(parameters.vmImage, 'vs2017-win2016' )}}:
Python37:
python.version: '>= 3.7'
python.architecture: x64
steps:
- task: UsePythonVersion@0
displayName: Use Python $(python.version)
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'
- template: ../steps/install-dependencies.yml
- bash: |
mkdir -p "$AGENT_HOMEDIRECTORY/.virtualenvs"
mkdir -p "$WORKON_HOME"
pip install certifi
export GIT_SSL_CAINFO=$(python -m certifi)
export LANG=C.UTF-8
python -m pip install --upgrade invoke requests parver bs4 vistir towncrier
python -m invoke vendoring.update
- template: ./run-manifest-check.yml
-48
View File
@@ -1,48 +0,0 @@
parameters:
vmImage:
jobs:
- job: Test_Primary
displayName: Test Primary
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
maxParallel: 4
matrix:
Python27:
python.version: '2.7'
python.architecture: x64
${{ if eq(parameters.vmImage, 'vs2017-win2016') }}:
# TODO remove once vs2017-win2016 has Python 3.7
Python37:
python.version: '>= 3.7.0-b2'
python.architecture: x64
${{ if ne(parameters.vmImage, 'vs2017-win2016' )}}:
Python37:
python.version: '>= 3.7'
python.architecture: x64
steps:
- ${{ if eq(parameters.vmImage, 'vs2017-win2016') }}:
- template: ./run-tests-windows.yml
- ${{ if ne(parameters.vmImage, 'vs2017-win2016') }}:
- template: ./run-tests.yml
- job: Test_Secondary
displayName: Test python3.6
# Run after Test_Primary so we don't devour time and jobs if tests are going to fail
# dependsOn: Test_Primary
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
maxParallel: 4
matrix:
Python36:
python.version: '3.6'
python.architecture: x64
steps:
- ${{ if eq(parameters.vmImage, 'vs2017-win2016') }}:
- template: ./run-tests-windows.yml
- ${{ if ne(parameters.vmImage, 'vs2017-win2016') }}:
- template: ./run-tests.yml
-27
View File
@@ -1,27 +0,0 @@
name: Pipenv Build Rules
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- docs/*
- news/*
- README.md
- pipenv/*.txt
- CHANGELOG.rst
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md
- .gitignore
- .gitattributes
- .editorconfig
jobs:
- template: jobs/test.yml
parameters:
vmImage: ubuntu-16.04
- template: jobs/run-vendor-scripts.yml
parameters:
vmImage: ubuntu-16.04
+75
View File
@@ -0,0 +1,75 @@
# Taken from https://github.com/pypa/pip/blob/ceaf75b9ede9a9c25bcee84fe512fa6774889685/.azure-pipelines/scripts/New-RAMDisk.ps1
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,
HelpMessage="Drive letter to use for the RAMDisk")]
[String]$drive,
[Parameter(HelpMessage="Size to allocate to the RAMDisk")]
[UInt64]$size=1GB
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
Write-Output "Installing FS-iSCSITarget-Server"
Install-WindowsFeature -Name FS-iSCSITarget-Server
Write-Output "Starting MSiSCSI"
Start-Service MSiSCSI
$retry = 10
do {
$service = Get-Service MSiSCSI
if ($service.Status -eq "Running") {
break;
}
$retry--
Start-Sleep -Milliseconds 500
} until ($retry -eq 0)
$service = Get-Service MSiSCSI
if ($service.Status -ne "Running") {
throw "MSiSCSI is not running"
}
Write-Output "Configuring Firewall"
Get-NetFirewallServiceFilter -Service MSiSCSI | Enable-NetFirewallRule
Write-Output "Configuring RAMDisk"
# Must use external-facing IP address, otherwise New-IscsiTargetPortal is
# unable to connect.
$ip = (
Get-NetIPAddress -AddressFamily IPv4 |
Where-Object {$_.IPAddress -ne "127.0.0.1"}
)[0].IPAddress
if (
-not (Get-IscsiServerTarget -ComputerName localhost | Where-Object {$_.TargetName -eq "ramdisks"})
) {
New-IscsiServerTarget `
-ComputerName localhost `
-TargetName ramdisks `
-InitiatorId IPAddress:$ip
}
$newVirtualDisk = New-IscsiVirtualDisk `
-ComputerName localhost `
-Path ramdisk:local$drive.vhdx `
-Size $size
Add-IscsiVirtualDiskTargetMapping `
-ComputerName localhost `
-TargetName ramdisks `
-Path ramdisk:local$drive.vhdx
Write-Output "Connecting to iSCSI"
New-IscsiTargetPortal -TargetPortalAddress $ip
Get-IscsiTarget | Where-Object {!$_.IsConnected} | Connect-IscsiTarget
Write-Output "Configuring disk"
$newDisk = Get-IscsiConnection |
Get-Disk |
Where-Object {$_.SerialNumber -eq $newVirtualDisk.SerialNumber}
Set-Disk -InputObject $newDisk -IsOffline $false
Initialize-Disk -InputObject $newDisk -PartitionStyle MBR
New-Partition -InputObject $newDisk -UseMaximumSize -DriveLetter $drive
Format-Volume -DriveLetter $drive -NewFileSystemLabel Temp -FileSystem NTFS
+32
View File
@@ -0,0 +1,32 @@
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(python.version)
architecture: '$(python.architecture)'
addToPath: true
displayName: Use Python $(python.version)
- bash: |
PYTHON_PATH=$(python -c 'import sys; print(sys.executable)')
echo "##vso[task.setvariable variable=PY_EXE]$PYTHON_PATH"
displayName: Set Python Path
- script: |
echo '##vso[task.setvariable variable=PIPENV_DEFAULT_PYTHON_VERSION]'$(python.version)
env:
PYTHON_VERSION: $(python.version)
- template: install-dependencies.yml
- script: |
python -m pip install --upgrade wheel pip setuptools twine readme_renderer[md]
python setup.py sdist bdist_wheel
twine check dist/*
displayName: Build and check package
env:
PY_EXE: $(PY_EXE)
GIT_SSL_CAINFO: $(GIT_SSL_CAINFO)
LANG: $(LANG)
PIPENV_DEFAULT_PYTHON_VERSION: $(PIPENV_DEFAULT_PYTHON_VERSION)
PYTHONWARNINGS: ignore:DEPRECATION
PIPENV_NOSPIN: '1'
@@ -1,6 +0,0 @@
steps:
- script: |
virtualenv D:\.venv
D:\.venv\Scripts\pip.exe install -e . && D:\.venv\Scripts\pipenv install --dev
echo D:\.venv\Scripts\pipenv --venv && echo D:\.venv\Scripts\pipenv --py && echo D:\.venv\Scripts\pipenv run python --version
displayName: Make Virtualenv
@@ -1,3 +1,31 @@
parameters:
python_version: ''
steps:
- script: 'python -m pip install --upgrade pip && python -m pip install -e .'
- script: |
echo "##vso[task.setvariable variable=LANG]C.UTF-8"
echo "##vso[task.setvariable variable=PIP_PROCESS_DEPENDENCY_LINKS]1"
displayName: Set Environment Variables
- script: |
echo "Python path: $(PY_EXE)"
echo "GIT_SSL_CAINFO: $(GIT_SSL_CAINFO)"
echo "PIPENV PYTHON VERSION: $(python.version)"
echo "python_version: ${{ parameters.python_version }}"
git submodule sync
git submodule update --init --recursive
$(PY_EXE) -m pip install --upgrade --upgrade-strategy=eager pip setuptools wheel
$(PY_EXE) -m pip install "virtualenv<20"
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ parameters.python_version }}
PYTHONWARNINGS: 'ignore:DEPRECATION'
PIPENV_NOSPIN: '1'
displayName: Make Virtualenv
- script: |
$(PY_EXE) -m pip install -e . --upgrade
$(PY_EXE) -m pipenv install --deploy --dev --python="$(PY_EXE)"
displayName: Upgrade Pip & Install Pipenv
env:
PYTHONWARNINGS: 'ignore:DEPRECATION'
@@ -0,0 +1,30 @@
parameters:
python_version: ''
steps:
- bash: |
pip install certifi
PYTHON_PATH=$(python -c 'import sys; print(sys.executable)')
CERTIFI_CONTENT=$(python -m certifi)
echo "##vso[task.setvariable variable=GIT_SSL_CAINFO]$CERTIFI_CONTENT"
echo "##vso[task.setvariable variable=PY_EXE]$PYTHON_PATH"
displayName: Set Python Path
env:
PYTHONWARNINGS: 'ignore:DEPRECATION'
- template: install-dependencies.yml
parameters:
python_version: ${{ parameters.python_version }}
- script: |
# Fix Git SSL errors
echo "Using pipenv python version: $(PIPENV_DEFAULT_PYTHON_VERSION)"
git submodule sync && git submodule update --init --recursive
pipenv run pytest -n 4 --junitxml=junit/test-results.xml
displayName: Run integration tests
env:
PYTHONWARNINGS: ignore:DEPRECATION
PIPENV_NOSPIN: '1'
PIPENV_DEFAULT_PYTHON_VERSION: ${{ parameters.python_version }}
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=accept-new -o CheckHostIP=no
@@ -0,0 +1,56 @@
parameters:
python_version: ''
python_architecture: ''
steps:
- task: PowerShell@2
inputs:
filePath: .azure-pipelines/scripts/New-RAMDisk.ps1
arguments: "-Drive R -Size 2GB"
displayName: Setup RAMDisk
- powershell: |
mkdir R:\virtualenvs
$acl = Get-Acl "R:\"
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule(
"Everyone", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow"
)
$acl.AddAccessRule($rule)
Set-Acl "R:\" $acl
displayName: Set RAMDisk Permissions
- powershell: |
Write-Host "##vso[task.setvariable variable=TEMP]R:\"
Write-Host "##vso[task.setvariable variable=TMP]R:\"
Write-Host "##vso[task.setvariable variable=WORKON_HOME]R:\virtualenvs"
Write-Host "##vso[task.setvariable variable=PIPENV_DEFAULT_PYTHON_VERSION]$env:PYTHON_VERSION"
Write-Host "##vso[task.setvariable variable=PIPENV_NOSPIN]1"
displayName: Fix Temp Variable
env:
PYTHON_VERSION: ${{ parameters.python_version }}
- powershell: |
pip install certifi
$env:PYTHON_PATH=$(python -c "import sys; print(sys.executable)")
$env:CERTIFI_CONTENT=$(python -m certifi)
echo "##vso[task.setvariable variable=GIT_SSL_CAINFO]$env:CERTIFI_CONTENT"
echo "##vso[task.setvariable variable=PY_EXE]$env:PYTHON_PATH"
displayName: Set Python Path
env:
PYTHONWARNINGS: 'ignore:DEPRECATION'
- template: install-dependencies.yml
parameters:
python_version: ${{ parameters.python_version }}
- script: |
git submodule sync
git submodule update --init --recursive
pipenv run pytest -ra -n 4 --junit-xml=junit/test-results.xml tests/
failOnStderr: false
displayName: Run integration tests
env:
TEMP: 'R:\'
PYTHONWARNINGS: 'ignore:DEPRECATION'
PIPENV_NOSPIN: 1
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=accept-new -o CheckHostIP=no
+21 -18
View File
@@ -1,25 +1,28 @@
steps:
- powershell: |
# Fix Git SSL errors
pip install certifi
python -m certifi > cacert.txt
Write-Host "##vso[task.setvariable variable=GIT_SSL_CAINFO]$(Get-Content cacert.txt)"
$env:GIT_SSL_CAINFO="$(Get-Content cacert.txt)"
# Shorten paths to get under MAX_PATH or else integration tests will fail
# https://bugs.python.org/issue18199
subst T: "$env:TEMP"
Write-Host "##vso[task.setvariable variable=TEMP]T:\"
$env:TEMP='T:\'
Write-Host "##vso[task.setvariable variable=TMP]T:\"
$env:TMP='T:\'
git submodule sync
git submodule update --init --recursive
D:\.venv\Scripts\pipenv run pytest -ra --ignore=pipenv\patched --ignore=pipenv\vendor --junitxml=test-results.xml tests
displayName: Run integration tests
- task: UsePythonVersion@0
inputs:
versionSpec: $(python.version)
architecture: '$(python.architecture)'
addToPath: true
displayName: Use Python $(python.version)
- script: |
echo '##vso[task.setvariable variable=PIPENV_DEFAULT_PYTHON_VERSION]'$(python.version)
env:
PYTHON_VERSION: $(python.version)
- ${{ if eq(parameters.vmImage, 'windows-latest') }}:
- template: run-tests-windows.yml
parameters:
python_version: $(python.version)
- ${{ if ne(parameters.vmImage, 'windows-latest') }}:
- template: run-tests-linux.yml
parameters:
python_version: $(python.version)
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFiles: '**/test-results.xml'
testResultsFiles: '**/junit/*.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
@@ -0,0 +1,32 @@
parameters:
python_version: ''
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(python.version)
architecture: '$(python.architecture)'
addToPath: true
displayName: Use Python $(python.version)
- bash: |
python -m pip install --upgrade --upgrade-strategy=eager pip requests certifi wheel setuptools
PYTHON_PATH=$(python -c 'import sys; print(sys.executable)')
CERTIFI_CONTENT=$(python -m certifi)
echo "##vso[task.setvariable variable=PY_EXE]$PYTHON_PATH"
echo "##vso[task.setvariable variable=GIT_SSL_CAINFO]$CERTIFI_CONTENT"
displayName: Set Python Path
- template: install-dependencies.yml
- script: |
python -m pip install --upgrade invoke parver bs4 vistir towncrier --upgrade-strategy=eager
python -m invoke vendoring.update
displayName: Run Vendor Scripts
env:
PY_EXE: $(PY_EXE)
GIT_SSL_CAINFO: $(GIT_SSL_CAINFO)
LANG: $(LANG)
PIPENV_DEFAULT_PYTHON_VERSION: $(python.version)
PYTHONWARNINGS: ignore:DEPRECATION
PIPENV_NOSPIN: '1'
-23
View File
@@ -1,23 +0,0 @@
name: Pipenv Build Rules
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- docs/*
- news/*
- README.md
- pipenv/*.txt
- CHANGELOG.rst
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md
- .gitignore
- .gitattributes
- .editorconfig
jobs:
- template: jobs/test.yml
parameters:
vmImage: vs2017-win2016
-5
View File
@@ -1,5 +0,0 @@
steps:
- label: ":python:"
commands:
# - make
- ./run-tests.sh
-10
View File
@@ -1,10 +0,0 @@
{
"name": "Pipenv Test Suite",
"steps": [
{
"type": "script",
"name": ":pipeline:",
"command": "buildkite-agent pipeline upload"
}
]
}
+11
View File
@@ -0,0 +1,11 @@
./examples
./tests
./docs
./news
./pipenv
./.git
./.buildkite
./peeps
./.github
./tasks
./.azure-pipelines
+1 -1
View File
@@ -4,7 +4,7 @@ If you're requesting a new feature, please use the PEEP process:
https://github.com/pypa/pipenv/blob/master/peeps/PEEP-000.md
Check the [diagnose documentation](https://docs.pipenv.org/diagnose/) for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way.
Check the [diagnose documentation](https://pipenv.pypa.io/en/latest/diagnose/) for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way.
Make sure to mention your debugging experience if the documented solution failed.
+1 -1
View File
@@ -5,7 +5,7 @@ about: Create a report to help us improve
Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Pipenv.
Check the [diagnose documentation](https://docs.pipenv.org/diagnose/) for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way.
Check the [diagnose documentation](https://pipenv.pypa.io/en/latest/diagnose/) for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way.
Make sure to mention your debugging experience if the documented solution failed.
+1 -1
View File
@@ -5,7 +5,7 @@ about: Suggest an idea for this project
Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Pipenv.
Check the [diagnose documentation](https://docs.pipenv.org/diagnose/) for common issues and the [PEEP list](https://github.com/pypa/pipenv/blob/master/peeps/) before posting! We may close your issue if it is very similar to one of them. Please be considerate and follow the PEEP process, or be on your way.
Check the [diagnose documentation](https://pipenv.pypa.io/en/latest/diagnose/) for common issues and the [PEEP list](https://github.com/pypa/pipenv/blob/master/peeps/) before posting! We may close your issue if it is very similar to one of them. Please be considerate and follow the PEEP process, or be on your way.
Make sure to mention your debugging experience if the documented solution failed.
+58
View File
@@ -0,0 +1,58 @@
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: ${{matrix.os}} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
python-version: [2.7, 3.6, 3.7, 3.8]
os: [MacOS, Ubuntu, Windows]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Get python path
id: python-path
run: |
echo ::set-output name=path::$(python -c "import sys; print(sys.executable)")
- name: Install latest pip, setuptools, wheel
run: |
python -m pip install --upgrade pip setuptools wheel --upgrade-strategy=eager
- name: Install dependencies
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }}
PYTHONWARNINGS: ignore:DEPRECATION
PYTHONIOENCODING: 'utf-8'
GIT_ASK_YESNO: 'false'
run: |
git submodule sync
git submodule update --init --recursive
python -m pip install "virtualenv<20"
python -m pip install -e . --upgrade
pipenv install --deploy --dev --python=${{ steps.python-path.outputs.path }}
- name: Run tests
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }}
PYTHONWARNINGS: ignore:DEPRECATION
PIPENV_NOSPIN: '1'
CI: '1'
GIT_ASK_YESNO: 'false'
PYPI_VENDOR_DIR: './tests/pypi/'
PYTHONIOENCODING: 'utf-8'
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=accept-new -o CheckHostIP=no
run: |
pipenv run pytest -ra -n 4 tests
+14
View File
@@ -145,6 +145,10 @@ venv.bak/
# mypy
.mypy_cache/
# Temporarily generating these with pytype locally for type safety
typeshed/
pytype.cfg
### Python Patch ###
.venv/
@@ -153,3 +157,13 @@ venv.bak/
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
.vs/slnx.sqlite
# mypy/typing section
typeshed/
.dmypy.json
mypyhtml/
XDG_CACHE_HOME/
snap/
prime/
stage/
pip-wheel-metadata/
+5 -2
View File
@@ -6,7 +6,7 @@
url = https://github.com/pinax/pinax.git
[submodule "tests/test_artifacts/git/requests"]
path = tests/test_artifacts/git/requests
url = https://github.com/requests/requests.git
url = https://github.com/psf/requests.git
[submodule "tests/test_artifacts/git/six"]
path = tests/test_artifacts/git/six
url = https://github.com/benjaminp/six.git
@@ -24,4 +24,7 @@
url = https://github.com/pallets/flask.git
[submodule "tests/test_artifacts/git/requests-2.18.4"]
path = tests/test_artifacts/git/requests-2.18.4
url = https://github.com/requests/requests
url = https://github.com/psf/requests
[submodule "tests/pypi"]
path = tests/pypi
url = https://github.com/sarugaku/pipenv-test-artifacts.git
+222 -67
View File
@@ -1,99 +1,254 @@
# Contribution Guidelines
Contributing to Pipenv
======================
Before opening any issues or proposing any pull requests, please do the
following:
If you\'re reading this, you\'re probably interested in contributing to
Pipenv. Thank you very much! Open source projects live-and-die based on
the support they receive from others, and the fact that you\'re even
considering contributing to the Pipenv project is *very* generous of
you.
1. Read our [Contributor's Guide](https://docs.pipenv.org/dev/contributing/).
2. Understand our [development philosophy](https://docs.pipenv.org/dev/philosophy/).
This document lays out guidelines and advice for contributing to this
project. If you\'re thinking of contributing, please start by reading
this document and getting a feel for how contributing to this project
works. If you have any questions, feel free to reach out to either [Dan
Ryan](https://github.com/techalchemy), [Tzu-ping
Chung](https://github.com/uranusjr), or [Nate
Prewitt](https://github.com/nateprewitt), the primary maintainers.
To get the greatest chance of helpful responses, please also observe the
following additional notes.
The guide is split into sections based on the type of contribution
you\'re thinking of making, with a section that covers general
guidelines for all contributors.
## Questions
General Guidelines
------------------
The GitHub issue tracker is for *bug reports* and *feature requests*. Please do
not use it to ask questions about how to use Pipenv. These questions should
instead be directed to [Stack Overflow](https://stackoverflow.com/). Make sure
that your question is tagged with the `pipenv` tag when asking it on
Stack Overflow, to ensure that it is answered promptly and accurately.
### Be Cordial
## Good Bug Reports
> **Be cordial or be on your way**. *---Kenneth Reitz*
Please be aware of the following things when filing bug reports:
Pipenv has one very important rule governing all forms of contribution,
including reporting bugs or requesting features. This golden rule is
\"[be cordial or be on your
way](https://www.kennethreitz.org/essays/be-cordial-or-be-on-your-way)\".
1. Avoid raising duplicate issues. *Please* use the GitHub issue search feature
to check whether your bug report or feature request has been mentioned in
the past. Duplicate bug reports and feature requests are a huge maintenance
burden on the limited resources of the project. If it is clear from your
report that you would have struggled to find the original, that's ok, but
if searching for a selection of words in your issue title would have found
the duplicate then the issue will likely be closed extremely abruptly.
2. When filing bug reports about exceptions or tracebacks, please include the
*complete* traceback. Partial tracebacks, or just the exception text, are
not helpful. Issues that do not contain complete tracebacks may be closed
without warning.
3. Make sure you provide a suitable amount of information to work with. This
means you should provide:
**All contributions are welcome**, as long as everyone involved is
treated with respect.
- Guidance on **how to reproduce the issue**. Ideally, this should be a
*small* code sample that can be run immediately by the maintainers.
Failing that, let us know what you're doing, how often it happens, what
environment you're using, etc. Be thorough: it prevents us needing to ask
further questions.
- Tell us **what you expected to happen**. When we run your example code,
what are we expecting to happen? What does "success" look like for your
code?
- Tell us **what actually happens**. It's not helpful for you to say "it
doesn't work" or "it fails". Tell us *how* it fails: do you get an
exception? A hang? The packages installed seem incorrect?
How was the actual result different from your expected result?
- Tell us **what version of Pipenv you're using**, and
**how you installed it**. Different versions of Pipenv behave
differently and have different bugs, and some distributors of Pipenv
ship patches on top of the code we supply.
### Get Early Feedback {#early-feedback}
If you do not provide all of these things, it will take us much longer to
fix your problem. If we ask you to clarify these and you never respond, we
will close your issue without fixing it.
If you are contributing, do not feel the need to sit on your
contribution until it is perfectly polished and complete. It helps
everyone involved for you to seek feedback as early as you possibly can.
Submitting an early, unfinished version of your contribution for
feedback in no way prejudices your chances of getting that contribution
accepted, and can save you from putting a lot of work into a
contribution that is not suitable for the project.
## Development Setup
### Contribution Suitability
Our project maintainers have the last word on whether or not a
contribution is suitable for Pipenv. All contributions will be
considered carefully, but from time to time, contributions will be
rejected because they do not suit the current goals or needs of the
project.
If your contribution is rejected, don\'t despair! As long as you
followed these guidelines, you will have a much better chance of getting
your next contribution accepted.
Questions
---------
The GitHub issue tracker is for *bug reports* and *feature requests*.
Please do not use it to ask questions about how to use Pipenv. These
questions should instead be directed to [Stack
Overflow](https://stackoverflow.com/). Make sure that your question is
tagged with the `pipenv` tag when asking it on Stack Overflow, to ensure
that it is answered promptly and accurately.
Code Contributions
------------------
### Steps for Submitting Code
When contributing code, you\'ll want to follow this checklist:
1. Understand our [development
philosophy](https://pipenv.pypa.io/en/latest/dev/philosophy/).
2. Fork the repository on GitHub.
3. Set up your `dev-setup`{.interpreted-text role="ref"}
4. Run the tests (`testing`{.interpreted-text role="ref"}) to confirm
they all pass on your system. If they don\'t, you\'ll need to
investigate why they fail. If you\'re unable to diagnose this
yourself, raise it as a bug report by following the guidelines in
this document: `bug-reports`{.interpreted-text role="ref"}.
5. Write tests that demonstrate your bug or feature. Ensure that they
fail.
6. Make your change.
7. Run the entire test suite again, confirming that all tests pass
*including the ones you just added*.
8. Send a GitHub Pull Request to the main repository\'s `master`
branch. GitHub Pull Requests are the expected method of code
collaboration on this project.
The following sub-sections go into more detail on some of the points
above.
### Development Setup {#dev-setup}
To get your development environment setup, run:
```sh
``` {.sh}
pip install -e .
pipenv install --dev
```
This will install the repo version of Pipenv and then install the development
dependencies. Once that has completed, you can start developing.
This will install the repo version of Pipenv and then install the
development dependencies. Once that has completed, you can start
developing.
The repo version of Pipenv must be installed over other global versions to
resolve conflicts with the `pipenv` folder being implicitly added to `sys.path`.
See [pypa/pipenv#2557](https://github.com/pypa/pipenv/issues/2557) for more details.
The repo version of Pipenv must be installed over other global versions
to resolve conflicts with the `pipenv` folder being implicitly added to
`sys.path`. See
[pypa/pipenv\#2557](https://github.com/pypa/pipenv/issues/2557) for more
details.
### Testing
Tests are written in `pytest` style and can be run very simply:
```sh
``` {.sh}
pytest
```
This will run all Pipenv tests, which can take awhile. To run a subset of the
tests, the standard pytest filters are available, such as:
This will run all Pipenv tests, which can take awhile. To run a subset
of the tests, the standard pytest filters are available, such as:
- provide a directory or file: `pytest tests/unit` or `pytest tests/unit/test_cmdparse.py`
- provide a keyword expression: `pytest -k test_lock_editable_vcs_without_install`
- provide a nodeid: `pytest tests/unit/test_cmdparse.py::test_parse`
- provide a test marker: `pytest -m lock`
- provide a directory or file: `pytest tests/unit` or
`pytest tests/unit/test_cmdparse.py`
- provide a keyword expression:
`pytest -k test_lock_editable_vcs_without_install`
- provide a nodeid: `pytest tests/unit/test_cmdparse.py::test_parse`
- provide a test marker: `pytest -m lock`
#### Package Index
### Code Review
Contributions will not be merged until they\'ve been code reviewed. You
should implement any code review feedback unless you strongly object to
it. In the event that you object to the code review feedback, you should
make your case clearly and calmly. If, after doing so, the feedback is
judged to still apply, you must either apply the feedback or withdraw
your contribution.
### Package Index
To speed up testing, tests that rely on a package index for locking and
installing use a local server that contains vendored packages in the
`tests/pypi` directory. Each vendored package should have it's own folder
containing the necessary releases. When adding a release for a package, it is
easiest to use either the `.tar.gz` or universal wheels (ex: `py2.py3-none`). If
a `.tar.gz` or universal wheel is not available, add wheels for all available
architectures and platforms.
`tests/pypi` directory. Each vendored package should have it\'s own
folder containing the necessary releases. When adding a release for a
package, it is easiest to use either the `.tar.gz` or universal wheels
(ex: `py2.py3-none`). If a `.tar.gz` or universal wheel is not
available, add wheels for all available architectures and platforms.
Documentation Contributions
---------------------------
Documentation improvements are always welcome! The documentation files
live in the `docs/` directory of the codebase. They\'re written in
[reStructuredText](http://docutils.sourceforge.net/rst.html), and use
[Sphinx](http://sphinx-doc.org/index.html) to generate the full suite of
documentation.
When contributing documentation, please do your best to follow the style
of the documentation files. This means a soft-limit of 79 characters
wide in your text files and a semi-formal, yet friendly and
approachable, prose style.
When presenting Python code, use single-quoted strings (`'hello'`
instead of `"hello"`).
Bug Reports
-----------
Bug reports are hugely important! They are recorded as [GitHub
issues](https://github.com/pypa/pipenv/issues). Please be aware of the
following things when filing bug reports:
1. Avoid raising duplicate issues. *Please* use the GitHub issue search
feature to check whether your bug report or feature request has been
mentioned in the past. Duplicate bug reports and feature requests
are a huge maintenance burden on the limited resources of the
project. If it is clear from your report that you would have
struggled to find the original, that\'s ok, but if searching for a
selection of words in your issue title would have found the
duplicate then the issue will likely be closed extremely abruptly.
2. When filing bug reports about exceptions or tracebacks, please
include the *complete* traceback. Partial tracebacks, or just the
exception text, are not helpful. Issues that do not contain complete
tracebacks may be closed without warning.
3. Make sure you provide a suitable amount of information to work with.
This means you should provide:
- Guidance on **how to reproduce the issue**. Ideally, this should
be a *small* code sample that can be run immediately by the
maintainers. Failing that, let us know what you\'re doing, how
often it happens, what environment you\'re using, etc. Be
thorough: it prevents us needing to ask further questions.
- Tell us **what you expected to happen**. When we run your
example code, what are we expecting to happen? What does
\"success\" look like for your code?
- Tell us **what actually happens**. It\'s not helpful for you to
say \"it doesn\'t work\" or \"it fails\". Tell us *how* it
fails: do you get an exception? A hang? The packages installed
seem incorrect? How was the actual result different from your
expected result?
- Tell us **what version of Pipenv you\'re using**, and **how you
installed it**. Different versions of Pipenv behave differently
and have different bugs, and some distributors of Pipenv ship
patches on top of the code we supply.
If you do not provide all of these things, it will take us much
longer to fix your problem. If we ask you to clarify these and you
never respond, we will close your issue without fixing it.
Run the tests
-------------
Three ways of running the tests are as follows:
1. `make test` (which uses `docker`)
2. `./run-tests.sh` or `run-tests.bat`
3. Using pipenv:
``` {.console}
$ git clone https://github.com/pypa/pipenv.git
$ cd pipenv
$ git submodule sync && git submodule update --init --recursive
$ pipenv install --dev
$ pipenv run pytest
```
For the last two, it is important that your environment is setup
correctly, and this may take some work, for example, on a specific Mac
installation, the following steps may be needed:
# Make sure the tests can access github
if [ "$SSH_AGENT_PID" = "" ]
then
eval `ssh-agent`
ssh-add
fi
# Use unix like utilities, installed with brew,
# e.g. brew install coreutils
for d in /usr/local/opt/*/libexec/gnubin /usr/local/opt/python/libexec/bin
do
[[ ":$PATH:" != *":$d:"* ]] && PATH="$d:${PATH}"
done
export PATH
# PIP_FIND_LINKS currently breaks test_uninstall.py
unset PIP_FIND_LINKS
+3 -1
View File
@@ -3,9 +3,11 @@ FROM heroku/heroku:18-build
ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
# Python, don't write bytecode!
ENV PYTHONDONTWRITEBYTECODE 1
# -- Install Pipenv:
RUN apt update && apt upgrade -y && apt install python3.7-dev -y
RUN apt update && apt install python3.7-dev libffi-dev -y
RUN curl --silent https://bootstrap.pypa.io/get-pip.py | python3.7
# Backwards compatility.
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright 2017 Kenneth Reitz
Copyright 2020 Python Packaging Authority
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+4 -1
View File
@@ -1,5 +1,5 @@
include LICENSE README.md CONTRIBUTING.md CODE_OF_CONDUCT.md CHANGELOG.rst NOTICES HISTORY.txt
include Makefile pyproject.toml get-pipenv.py
include Makefile pyproject.toml get-pipenv.py .dockerignore *.yml
include examples/Pipfil*
recursive-include pipenv LICENSE LICENSE* *LICENSE* *COPYING* t32.exe t64.exe w32.exe w64.exe cacert.pem
recursive-include pipenv *.cfg
@@ -9,6 +9,7 @@ recursive-include pipenv Makefile
recursive-include pipenv/vendor vendor.txt
recursive-include pipenv README
recursive-include pipenv *.json
recursive-include pipenv *.rst
include pipenv/patched/notpip/_vendor/vendor.txt
include pipenv/patched/safety.zip pipenv/patched/patched.txt
include pipenv/vendor/pipreqs/stdlib pipenv/vendor/pipreqs/mapping
@@ -37,3 +38,5 @@ prune docs/build
prune news
prune tasks
prune tests
prune pipenv/vendor/importlib_metadata/tests
prune pipenv/vendor/importlib_resources/tests
+113
View File
@@ -1,4 +1,117 @@
get_venv_dir:=$(shell mktemp -d 2>/dev/null || mktemp -d -t 'tmpvenv')
venv_dir := $(get_venv_dir)/pipenv_venv
venv_file := $(CURDIR)/.test_venv
get_venv_path =$(file < $(venv_file))
# This is how we will build tag-specific wheels, e.g. py36 or py37
PY_VERSIONS:= 2.7 3.5 3.6 3.7 3.8
# This is how we will build generic wheels, e.g. py2 or py3
INSTALL_TARGETS := $(addprefix install-py,$(PY_VERSIONS))
CLEAN_TARGETS := $(addprefix clean-py,$(PY_VERSIONS))
DATE_STRING := $(shell date +%Y.%m.%d)
THIS_MONTH_DATE := $(shell date +%Y.%m.01)
NEXT_MONTH_DATE := $(shell date -d "+1 month" +%Y.%m.01)
format:
black pipenv/*.py
test:
docker-compose up
.PHONY: install
install:
pip install -e .
install.stamp: install
@touch install.stamp
.PHONY: install-py%
install-py%: install.stamp
@echo building for $(addprefix python, $(subst install-py,,$@))
PIPENV_PYTHON=$(subst install-py,,$@) pipenv install --dev
install-virtualenvs.stamp: ${INSTALL_TARGETS}
@touch install-virtualenvs.stamp
.PHONY: ramdisk
ramdisk:
sudo mkdir -p /mnt/ramdisk
sudo mount -t tmpfs -o size=2g tmpfs /mnt/ramdisk
sudo chown -R ${USER}:${USER} /mnt/ramdisk
.PHONY: ramdisk-virtualenv
ramdisk-virtualenv: ramdisk
[ ! -e "/mnt/ramdisk/.venv/bin/activate" ] && \
python -m virtualenv /mnt/ramdisk/.venv
@echo "/mnt/ramdisk/.venv" >> $(venv_file)
.PHONY: virtualenv
virtualenv:
[ ! -e $(venv_dir) ] && rm -rf $(venv_file) && python -m virtualenv $(venv_dir)
@echo $(venv_dir) >> $(venv_file)
.PHONY: test-install
test-install: virtualenv
. $(get_venv_path)/bin/activate && \
python -m pip install --upgrade pip virtualenv -e .[tests,dev] && \
pipenv install --dev
.PHONY: submodules
submodules:
git submodule sync
git submodule update --init --recursive
.PHONY: tests
tests: virtualenv submodules test-install
. $(get_venv_path)/bin/activate && \
pipenv run pytest -ra -vvv --full-trace --tb=long
.PHONY: test-specific
test-specific: submodules virtualenv test-install
. $(get_venv_path)/bin/activate && pipenv run pytest -ra -k '$(tests)'
.PHONY: retest
retest: virtualenv submodules test-install
. $(get_venv_path)/bin/activate && pipenv run pytest -ra -k 'test_check_unused or test_install_editable_git_tag or test_get_vcs_refs or test_skip_requirements_when_pipfile or test_editable_vcs_install or test_basic_vcs_install or test_git_vcs_install or test_ssh_vcs_install or test_vcs_can_use_markers' -vvv --full-trace --tb=long
.PHONY: build
build: install-virtualenvs.stamp install.stamp
PIPENV_PYTHON=3.7 pipenv run python setup.py sdist bdist_wheel
.PHONY: update-version
update-version:
@sed -i "s/^__version__ = .\+$\/__version__ = \"$(DATE_STRING)\"/g" ./pipenv/__version__.py
.PHONY: update-prerelease-version
update-prerelease-version:
@sed -i "s/^__version__ = .\+$\/__version__ = \"$(THIS_MONTH_DATE).a1\"/g" ./pipenv/__version__.py
.PHONY: pre-bump
pre-bump:
@sed -i "s/^__version__ = .\+$\/__version__ = \"$(NEXT_MONTH_DATE).dev0\"/g" ./pipenv/__version__.py
.PHONY: lint
lint:
flake8 .
.PHONY: check
check: build.stamp
pipenv run twine check dist/* && pipenv run check-manifest .
.PHONY: upload-test
upload-test: build
twine upload --repository=testpypi dist/*
.PHONY: clean-py%
clean-py%:
@echo "cleaning environment for $@..."
PIPENV_PYTHON="$(subst clean-py,,$@)" pipenv --rm
.PHONY: cleanbuild
cleanbuild:
@echo "cleaning up existing builds..."
@rm -rf build/ dist/
@rm -rf build.stamp
.PHONY: clean
clean:
rm -rf install.stamp build.stamp install-virtualenvs.stamp
+3 -17
View File
@@ -1,27 +1,13 @@
[dev-packages]
pipenv = {path = ".", editable = true}
"flake8" = ">=3.3.0,<4"
pytest = "*"
mock = "*"
sphinx = "<=1.5.5"
twine = "*"
pipenv = {path = ".", editable = true, extras = ["tests", "dev"]}
sphinx-click = "*"
pytest-xdist = "*"
click = "*"
pytest-pypy = {path = "./tests/pytest-pypi", editable = true}
pytest-tap = "*"
flaky = "*"
pytest_pypi = {path = "./tests/pytest-pypi", editable = true}
stdeb = {version="*", markers="sys_platform == 'linux'"}
black = {version="*", markers="python_version >= '3.6'"}
pytz = "*"
towncrier = {git = "https://github.com/hawkowl/towncrier.git", editable = true, ref = "master"}
parver = "*"
invoke = "*"
jedi = "*"
isort = "*"
rope = "*"
passa = {editable = true, git = "https://github.com/sarugaku/passa.git"}
bs4 = "*"
passa = {git = "https://github.com/sarugaku/passa.git"}
[packages]
Generated
+526 -401
View File
File diff suppressed because it is too large Load Diff
+17 -14
View File
@@ -3,11 +3,8 @@ Pipenv: Python Development Workflow for Humans
[![image](https://img.shields.io/pypi/v/pipenv.svg)](https://python.org/pypi/pipenv)
[![image](https://img.shields.io/pypi/l/pipenv.svg)](https://python.org/pypi/pipenv)
[![image](https://badge.buildkite.com/79c7eccf056b17c3151f3c4d0e4c4b8b724539d84f1e037b9b.svg?branch=master)](https://code.kennethreitz.org/source/pipenv/)
[![Azure Pipelines build status (Linux)](https://dev.azure.com/pypa/pipenv/_apis/build/status/pipenv%20CI%20(Linux)?branchName=master&label=Linux)](https://dev.azure.com/pypa/pipenv/_build/latest?definitionId=13&branchName=master)
[![Azure Pipelines build status (Windows)](https://dev.azure.com/pypa/pipenv/_apis/build/status/pipenv%20CI%20(Windows)?branchName=master&label=Windows)](https://dev.azure.com/pypa/pipenv/_build/latest?definitionId=12&branchName=master)
[![Azure Pipelines Build Status](https://dev.azure.com/pypa/pipenv/_apis/build/status/Pipenv%20CI?branchName=master)](https://dev.azure.com/pypa/pipenv/_build/latest?definitionId=16&branchName=master)
[![image](https://img.shields.io/pypi/pyversions/pipenv.svg)](https://python.org/pypi/pipenv)
[![image](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/kennethreitz)
------------------------------------------------------------------------
@@ -20,7 +17,7 @@ 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.
![image](http://media.kennethreitz.com.s3.amazonaws.com/pipenv.gif)
![GIF demonstrating Pipenv's usage](https://gist.githubusercontent.com/jlusk/855d611bbcfa2b159839db73d07f6ce9/raw/7f5743401809f7e630ee8ff458faa980e19924a0/pipenv.gif)
The problems that Pipenv seeks to solve are multi-faceted:
@@ -46,23 +43,29 @@ If you\'re on MacOS, you can install Pipenv easily with Homebrew:
$ brew install pipenv
Or, if you\'re using Fedora 28:
Or, if you\'re using Debian Buster+:
$ sudo apt install pipenv
Or, if you\'re using Fedora:
$ sudo dnf install pipenv
Or, if you\'re using FreeBSD:
Otherwise, refer to the [documentation](https://docs.pipenv.org/install/) for instructions.
# pkg install py36-pipenv
When none of the above is an option:
$ pip install pipenv
Otherwise, refer to the [documentation](https://pipenv.pypa.io/en/latest/#install-pipenv-today) for instructions.
✨🍰✨
☤ User Testimonials
-------------------
**Jannis Leidel**, former pip maintainer---
: *Pipenv is the porcelain I always wanted to build for pip. It fits
my brain and mostly replaces virtualenvwrapper and manual pip calls
for me. Use it.*
**David Gang**---
: *This package manager is really awesome. For the first time I know
@@ -297,4 +300,4 @@ Use the shell:
☤ Documentation
---------------
Documentation resides over at [pipenv.org](http://pipenv.org/).
Documentation resides over at [pipenv.pypa.io](https://pipenv.pypa.io/en/latest/).
+122
View File
@@ -0,0 +1,122 @@
name: CI
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- docs/*
- news/*
- peeps/*
- examples/*
- pytest.ini
- README.md
- pipenv/*.txt
- CHANGELOG.rst
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md
- .gitignore
- .gitattributes
- .editorconfig
variables:
- group: CI
jobs:
- job: TestVendoring
displayName: Vendoring
pool:
vmImage: 'Ubuntu-latest'
variables:
python.version: '3.7'
python.architecture: x64
steps:
- template: .azure-pipelines/steps/run-vendor-scripts.yml
parameters:
vmImage: 'Ubuntu-latest'
- job: TestPackaging
displayName: Packaging
pool:
vmImage: 'Ubuntu-latest'
variables:
python.version: '3.7'
python.architecture: x64
steps:
- template: .azure-pipelines/steps/build-package.yml
parameters:
vmImage: 'Ubuntu-latest'
- job: TestLinux
displayName: Linux /
pool:
vmImage: 'Ubuntu-latest'
strategy:
matrix:
"2.7":
python.version: '2.7'
python.architecture: x64
"3.6":
python.version: '3.6'
python.architecture: x64
"3.7":
python.version: '3.7'
python.architecture: x64
"3.8":
python.version: '3.8'
python.architecture: x64
maxParallel: 8
steps:
- template: .azure-pipelines/steps/run-tests.yml
parameters:
vmImage: 'Ubuntu-latest'
- job: TestWindows
displayName: Windows /
timeoutInMinutes: 0
pool:
vmImage: windows-latest
strategy:
matrix:
"2.7":
python.version: '2.7'
python.architecture: x64
"3.6":
python.version: '3.6'
python.architecture: x64
"3.7":
python.version: '3.7'
python.architecture: x64
"3.8":
python.version: '3.8'
python.architecture: x64
maxParallel: 8
steps:
- template: .azure-pipelines/steps/run-tests.yml
parameters:
vmImage: windows-latest
- job: TestMacOS
displayName: MacOS /
pool:
vmImage: macOS-latest
strategy:
matrix:
"2.7":
python.version: '2.7'
python.architecture: x64
"3.6":
python.version: '3.6'
python.architecture: x64
"3.7":
python.version: '3.7'
python.architecture: x64
"3.8":
python.version: '3.8'
python.architecture: x64
maxParallel: 8
steps:
- template: .azure-pipelines/steps/run-tests.yml
parameters:
vmImage: macOS-latest
+1 -2
View File
@@ -18,7 +18,6 @@
/* Remain Responsive! */
@media screen and (max-width: 1008px) {
div.sphinxsidebar {display: none;}
div.document {width: 100%!important;}
/* Have code blocks escape the document right-margin. */
@@ -60,7 +59,7 @@
</style>
<!-- GitHub Logo -->
<a href="https://github.com/kennethreitz/pipenv" class="github-corner" aria-label="View source on GitHub">
<a href="https://github.com/pypa/pipenv" class="github-corner" aria-label="View source on GitHub">
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
+30 -15
View File
@@ -1,6 +1,6 @@
<p class="logo">
<a href="{{ pathto(master_doc) }}">
<img class="logo" src="{{ pathto('_static/pipenv.png', 1) }}" title="https://kennethreitz.org/tattoos"/>
<img class="logo" src="{{ pathto('_static/pipenv.png', 1) }}" title="Gift-wrapped box w/ 'pipenv' on the ribbon"/>
</a>
</p>
@@ -8,21 +8,37 @@
<iframe src="https://ghbtns.com/github-btn.html?user=pypa&repo=pipenv&type=watch&count=true&size=large"
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
<style>
.algolia-autocomplete{
width: 100%;
height: 1.5em
}
.algolia-autocomplete a{
border-bottom: none !important;
}
#doc_search{
width: 100%;
height: 100%;
}
</style>
<input id="doc_search" placeholder="Search the doc" autofocus/>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js" onload="docsearch({
apiKey: '0dbb76467f0c180a1344fc46858df17b',
indexName: 'pipenv',
inputSelector: '#doc_search',
debug: false // Set debug to true if you want to inspect the dropdown
})" async></script>
<p>
<strong>Pipenv</strong> is a production-ready tool that aims to bring the best of all packaging worlds to the Python world. It harnesses Pipfile, pip, and virtualenv into one single command.
<p>It features very pretty terminal colors.</p>
</p>
<h3>Stay Informed</h3>
<p>Receive updates on new releases and upcoming projects.</p>
<p><iframe src="https://ghbtns.com/github-btn.html?user=kennethreitz&type=follow&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="20"></iframe></p>
<p><a href="https://twitter.com/kennethreitz" class="twitter-follow-button" data-show-count="false">Follow @kennethreitz</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script></p>
<p><a href="https://saythanks.io/to/kennethreitz">Say Thanks!</a></p>
<p><a href="http://tinyletter.com/kennethreitz">Join Mailing List</a>.</p>
<p><a href="https://twitter.com/ThePyPA" class="twitter-follow-button" data-show-count="false">Follow @ThePyPA</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script></p>
<p><a href="https://mail.python.org/mailman3/lists/distutils-sig.python.org/">Join Mailing List</a>.</p>
<h3>Other Projects</h3>
@@ -30,7 +46,7 @@
<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>
<p>More projects founded by <a href="http://kennethreitz.org/">Kenneth Reitz</a>:</p>
<ul>
<li><a href="http://pep8.org/">pep8.org</a></li>
<li><a href="http://httpbin.org/">httpbin.org</a></li>
@@ -39,7 +55,7 @@
<li><a href="http://python-requests.org/">Requests: HTTP for Humans</a></li>
<li><a href="https://github.com/kennethreitz/maya">Maya: Datetimes for Humans</a></li>
<li><a href="https://github.com/kennethreitz/records">Records: SQL for Humans</a></li>
<li><a href="http://www.git-legit.org">Legit: Git for Humans</a></li>
<li><a href="https://frostming.github.io/legit">Legit: Git for Humans</a></li>
<li><a href="http://docs.python-tablib.org/en/latest/">Tablib: Tabular Datasets</a></li>
</ul>
@@ -50,12 +66,11 @@
<p></p>
<li><a href="http://github.com/pypa/pipenv">Pipenv @ GitHub</a></li>
<li><a href="http://pypi.python.org/pypi/pipenv">Pipenv @ PyPI</a></li>
<li><a href="https://github.com/pypa/pipenv">Pipenv @ GitHub</a></li>
<li><a href="https://pypi.org/pypi/pipenv">Pipenv @ PyPI</a></li>
<li><a href="https://launchpad.net/~pypa/+archive/ubuntu/ppa">Pipenv PPA (PyPA)</a></li>
<li><a href="http://github.com/kennethreitz/pipenv/issues">Issue Tracker</a></li>
<li><a href="https://github.com/pypa/pipenv/issues">Issue Tracker</a></li>
<hr>
<li><a href="http://pipenv-ja.readthedocs.io/ja/translate-ja/">日本語</a></li>
<li><a href="https://pipenv-ja.readthedocs.io/ja/translate-ja/">日本語</a></li>
<li><a href="https://pipenv-es.readthedocs.io/es/latest/">Español</a></li>
</ul>
+28 -9
View File
@@ -8,6 +8,27 @@
<iframe src="https://ghbtns.com/github-btn.html?user=pypa&repo=pipenv&type=watch&count=true&size=large"
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
<style>
.algolia-autocomplete{
width: 100%;
height: 1.5em
}
.algolia-autocomplete a{
border-bottom: none !important;
}
#doc_search{
width: 100%;
height: 100%;
}
</style>
<input id="doc_search" placeholder="Search the doc" autofocus/>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js" onload="docsearch({
apiKey: '0dbb76467f0c180a1344fc46858df17b',
indexName: 'pipenv',
inputSelector: '#doc_search',
debug: false // Set debug to true if you want to inspect the dropdown
})" async></script>
<p>
<strong>Pipenv</strong> is a production-ready tool that aims to bring the best of all packaging worlds to the Python world. It harnesses Pipfile, pip, and virtualenv into one single command.
@@ -17,12 +38,11 @@
<h3>Stay Informed</h3>
<p>Receive updates on new releases and upcoming projects.</p>
<p><iframe src="https://ghbtns.com/github-btn.html?user=kennethreitz&type=follow&count=true"
<p><iframe src="https://ghbtns.com/github-btn.html?user=pypa&type=follow&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="20"></iframe></p>
<p><a href="https://twitter.com/kennethreitz" class="twitter-follow-button" data-show-count="false">Follow @kennethreitz</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script></p>
<p><a href="https://saythanks.io/to/kennethreitz">Say Thanks!</a></p>
<p><a href="http://tinyletter.com/kennethreitz">Join Mailing List</a>.</p>
<p><a href="https://twitter.com/ThePyPA" class="twitter-follow-button" data-show-count="false">Follow @ThePyPA</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script></p>
<p><a href="https://mail.python.org/mailman3/lists/distutils-sig.python.org/">Join Mailing List</a>.</p>
<h3>Other Projects</h3>
@@ -30,7 +50,7 @@
<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>
<p>More projects founded by <a href="http://kennethreitz.org/">Kenneth Reitz</a>:</p>
<ul>
<li><a href="http://pep8.org/">pep8.org</a></li>
<li><a href="http://httpbin.org/">httpbin.org</a></li>
@@ -38,7 +58,7 @@
<li><a href="http://python-guide.org">The Python Guide</a></li>
<li><a href="http://python-requests.org/">Requests: HTTP for Humans</a></li>
<li><a href="https://github.com/kennethreitz/records">Records: SQL for Humans</a></li>
<li><a href="http://www.git-legit.org">Legit: Git for Humans</a></li>
<li><a href="https://frostming.github.io/legit">Legit: Git for Humans</a></li>
<li><a href="http://docs.python-tablib.org/en/latest/">Tablib: Tabular Datasets</a></li>
<li><a href="http://markdownplease.com">Markdown, Please!</a></li>
</ul>
@@ -51,11 +71,10 @@
<p></p>
<li><a href="http://github.com/pypa/pipenv">Pipenv @ GitHub</a></li>
<li><a href="http://pypi.python.org/pypi/pipenv">Pipenv @ PyPI</a></li>
<li><a href="http://pypi.org/project/pipenv">Pipenv @ PyPI</a></li>
<li><a href="https://launchpad.net/~pypa/+archive/ubuntu/ppa">Pipenv PPA (PyPA)</a></li>
<li><a href="http://github.com/kennethreitz/pipenv/issues">Issue Tracker</a></li>
<li><a href="http://github.com/pypa/pipenv/issues">Issue Tracker</a></li>
<hr>
<li><a href="http://pipenv-ja.readthedocs.io/ja/translate-ja/">日本語</a></li>
<li><a href="https://pipenv-es.readthedocs.io/es/latest/">Español</a></li>
</ul>
+44 -10
View File
@@ -20,7 +20,7 @@ This document covers some of Pipenv's more glorious and advanced features.
If you'd like a specific package to be installed with a specific package index, you can do the following::
[[source]]
url = "https://pypi.python.org/simple"
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
@@ -71,6 +71,11 @@ Luckily - pipenv will hash your Pipfile *before* expanding environment
variables (and, helpfully, will substitute the environment variables again when
you install from the lock file - so no need to commit any secrets! Woo!)
If your credentials contain a special character, surround the references to the environment variables with quotation marks. For example, if your password contain a double quotation mark, surround the password variable with single quotation marks. Otherwise, you may get a ``ValueError, "No closing quotation"`` error while installing dependencies. ::
[[source]]
url = "https://$USERNAME:'${PASSWORD}'@mypypi.example.com/simple"
☤ Specifying Basically Anything
-------------------------------
@@ -339,6 +344,21 @@ If a ``.env`` file is present in your project, ``$ pipenv shell`` and ``$ pipenv
>>> os.environ['HELLO']
'WORLD'
Shell like variable expansion is available in ``.env`` files using `${VARNAME}` syntax.::
$ cat .env
CONFIG_PATH=${HOME}/.config/foo
$ pipenv run python
Loading .env environment variables…
Python 3.7.6 (default, Dec 19 2019, 22:52:49)
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ['CONFIG_PATH']
'/home/kennethreitz/.config/foo'
This is very useful for keeping production credentials out of your codebase.
We do not recommend committing ``.env`` files into source control!
@@ -350,15 +370,19 @@ To prevent pipenv from loading the ``.env`` file, set the ``PIPENV_DONT_LOAD_ENV
$ PIPENV_DONT_LOAD_ENV=1 pipenv shell
See `theskumar/python-dotenv <https://github.com/theskumar/python-dotenv>`_ for more information on ``.env`` files.
☤ Custom Script Shortcuts
-------------------------
Pipenv supports creating custom shortcuts in the (optional) ``[scripts]`` section of your Pipfile.
Pipenv supports creating custom shortcuts in the (optional) ``[scripts]`` section of your Pipfile.
You can then run ``pipenv run <shortcut name>`` in your terminal to run the command in the
context of your pipenv virtual environment even if you have not activated the pipenv shell first.
context of your pipenv virtual environment even if you have not activated the pipenv shell first.
For example, in your Pipfile::
For example, in your Pipfile:
.. code-block:: toml
[scripts]
printspam = "python -c \"print('I am a silly example, no one would need to do this')\""
@@ -369,18 +393,26 @@ And then in your terminal::
I am a silly example, no one would need to do this
Commands that expect arguments will also work.
For example::
For example:
.. code-block:: toml
[scripts]
echospam = "echo I am really a very silly example"
::
$ pipenv run echospam "indeed"
I am really a very silly example indeed
☤ Support for Environment Variables
-----------------------------------
Pipenv supports the usage of environment variables in values. For example::
Pipenv supports the usage of environment variables in place of authentication fragments
in your Pipfile. These will only be parsed if they are present in the ``[[source]]``
section. For example:
.. code-block:: toml
[[source]]
url = "https://${PYPI_USERNAME}:${PYPI_PASSWORD}@my_private_repo.example.com/simple"
@@ -395,8 +427,10 @@ Pipenv supports the usage of environment variables in values. For example::
records = "*"
Environment variables may be specified as ``${MY_ENVAR}`` or ``$MY_ENVAR``.
On Windows, ``%MY_ENVAR%`` is supported in addition to ``${MY_ENVAR}`` or ``$MY_ENVAR``.
.. _configuration-with-environment-variables:
☤ Configuration With Environment Variables
------------------------------------------
@@ -467,7 +501,7 @@ and the corresponding Makefile::
pipenv install --dev
test:
pipenv run py.test tests
pipenv run pytest tests
Tox Automation Project
@@ -483,7 +517,7 @@ and external testing::
deps = pipenv
commands=
pipenv install --dev
pipenv run py.test tests
pipenv run pytest tests
[testenv:flake8-py3]
basepython = python3.4
@@ -492,7 +526,7 @@ and external testing::
pipenv run flake8 --version
pipenv run flake8 setup.py docs project test
Pipenv will automatically use the virtualenv provided by ``tox``. If ``pipenv install --dev`` installs e.g. ``pytest``, then installed command ``py.test`` will be present in given virtualenv and can be called directly by ``py.test tests`` instead of ``pipenv run py.test tests``.
Pipenv will automatically use the virtualenv provided by ``tox``. If ``pipenv install --dev`` installs e.g. ``pytest``, then installed command ``pytest`` will be present in given virtualenv and can be called directly by ``pytest tests`` instead of ``pipenv run pytest tests``.
You might also want to add ``--ignore-pipfile`` to ``pipenv install``, as to
not accidentally modify the lock-file on each test run. This causes Pipenv
@@ -508,7 +542,7 @@ probably a good idea in any case.
A 3rd party plugin, `tox-pipenv`_ is also available to use Pipenv natively with tox.
.. _Requests: https://github.com/kennethreitz/requests
.. _Requests: https://github.com/psf/requests
.. _tox: https://tox.readthedocs.io/en/latest/
.. _tox-pipenv: https://tox-pipenv.readthedocs.io/en/latest/
.. _Travis-CI: https://travis-ci.org/
+19 -13
View File
@@ -10,6 +10,12 @@ This document covers some of Pipenv's more basic features.
☤ Example Pipfile & Pipfile.lock
--------------------------------
Pipfiles contain information for the dependencies of the project, and supersedes
the requirements.txt file used in most Python projects. You should add a Pipfile in the
Git repository letting users who clone the repository know the only thing required would be
installing Pipenv in the machine and typing ``pipenv install``. Pipenv is a reference
implementation for using Pipfile.
.. _example_files:
Here is a simple example of a ``Pipfile`` and the resulting ``Pipfile.lock``.
@@ -125,8 +131,9 @@ Example Pipfile.lock
- Generally, keep both ``Pipfile`` and ``Pipfile.lock`` in version control.
- Do not keep ``Pipfile.lock`` in version control if multiple versions of Python are being targeted.
- Specify your target Python version in your `Pipfile`'s ``[requires]`` section. Ideally, you should only have one target Python version, as this is a deployment tool.
- Specify your target Python version in your `Pipfile`'s ``[requires]`` section. Ideally, you should only have one target Python version, as this is a deployment tool. ``python_version`` should be in the format ``X.Y`` and ``python_full_version`` should be in ``X.Y.Z`` format.
- ``pipenv install`` is fully compatible with ``pip install`` syntax, for which the full documentation can be found `here <https://pip.pypa.io/en/stable/user_guide/#installing-packages>`_.
- Note that the ``Pipfile`` uses the `TOML Spec <https://github.com/toml-lang/toml#user-content-spec>`_.
@@ -182,12 +189,12 @@ in your ``Pipfile.lock`` for now, run ``pipenv lock --keep-outdated``. Make sur
☤ Specifying Versions of a Package
----------------------------------
You can specify versions of a package using the `Semantic Versioning scheme <https://semver.org/>`_
(i.e. ``major.minor.micro``).
You can specify versions of a package using the `Semantic Versioning scheme <https://semver.org/>`_
(i.e. ``major.minor.micro``).
For example, to install requests you can use: ::
$ pipenv install requests~=1.2 # equivalent to requests~=1.2.0
$ pipenv install requests~=1.2
Pipenv will install version ``1.2`` and any minor update, but not ``2.0``.
@@ -195,19 +202,19 @@ This will update your ``Pipfile`` to reflect this requirement, automatically.
In general, Pipenv uses the same specifier format as pip. However, note that according to `PEP 440`_ , you can't use versions containing a hyphen or a plus sign.
.. _`PEP 440`: <https://www.python.org/dev/peps/pep-0440/>
.. _`PEP 440`: https://www.python.org/dev/peps/pep-0440/
To make inclusive or exclusive version comparisons you can use: ::
$ pipenv install "requests>=1.4" # will install a version equal or larger than 1.4.0
$ pipenv install "requests<=2.13" # will install a version equal or lower than 2.13.0
$ pipenv install "requests>2.19" # will install 2.19.1 but not 2.19.0
$ pipenv install "requests>2.19" # will install 2.19.1 but not 2.19.0
.. note:: The use of ``" "`` around the package and version specification is highly recommended
.. note:: The use of double quotes around the package and version specification (i.e. ``"requests>2.19"``) is highly recommended
to avoid issues with `Input and output redirection <https://robots.thoughtbot.com/input-output-redirection-in-the-shell>`_
in Unix-based operating systems.
in Unix-based operating systems.
The use of ``~=`` is preferred over the ``==`` identifier as the former prevents pipenv from updating the packages: ::
The use of ``~=`` is preferred over the ``==`` identifier as the latter prevents pipenv from updating the packages: ::
$ pipenv install "requests~=2.2" # locks the major version of the package (this is equivalent to using ==2.*)
@@ -215,7 +222,7 @@ To avoid installing a specific version you can use the ``!=`` identifier.
For an in depth explanation of the valid identifiers and more complex use cases check `the relevant section of PEP-440`_.
.. _`the relevant section of PEP-440`: https://www.python.org/dev/peps/pep-0440/#version-specifiers>
.. _`the relevant section of PEP-440`: https://www.python.org/dev/peps/pep-0440/#version-specifiers
☤ Specifying Versions of Python
-------------------------------
@@ -314,6 +321,7 @@ The user can provide these additional parameters:
- ``--dev`` — Install both ``develop`` and ``default`` packages from ``Pipfile``.
- ``--system`` — Use the system ``pip`` command rather than the one from your virtualenv.
- ``--deploy`` — Make sure the packages are properly locked in Pipfile.lock, and abort if the lock file is out-of-date.
- ``--ignore-pipfile`` — Ignore the ``Pipfile`` and install from the ``Pipfile.lock``.
- ``--skip-lock`` — Ignore the ``Pipfile.lock`` and install from the ``Pipfile``. In addition, do not write out a ``Pipfile.lock`` reflecting changes to the ``Pipfile``.
@@ -398,10 +406,8 @@ environment into production. You can use ``pipenv lock`` to compile your depende
your development environment and deploy the compiled ``Pipfile.lock`` to all of your
production environments for reproducible builds.
.. note:
.. note::
If you'd like a ``requirements.txt`` output of the lockfile, run ``$ pipenv lock -r``.
This will include all hashes, however (which is great!). To get a ``requirements.txt``
without hashes, use ``$ pipenv run pip freeze``.
.. _configuration-with-environment-variables:https://docs.pipenv.org/advanced/#configuration-with-environment-variables
+8
View File
@@ -0,0 +1,8 @@
.. _cli:
Pipenv CLI Reference
======================================
.. click:: pipenv:cli
:prog: pipenv
:show-nested:
+2 -2
View File
@@ -57,8 +57,8 @@ master_doc = 'index'
# General information about the project.
project = u'pipenv'
copyright = u'2017. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project'
author = u'Kenneth Reitz'
copyright = u'2020. A project founded by <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a>'
author = u'Python Packaging Authority'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
+141 -19
View File
@@ -20,8 +20,12 @@ The guide is split into sections based on the type of contribution you're
thinking of making, with a section that covers general guidelines for all
contributors.
General Guidelines
------------------
Be Cordial
----------
~~~~~~~~~~
**Be cordial or be on your way**. *—Kenneth Reitz*
@@ -34,10 +38,11 @@ everyone involved is treated with respect.
.. _be cordial or be on your way: https://www.kennethreitz.org/essays/be-cordial-or-be-on-your-way
.. _early-feedback:
Get Early Feedback
------------------
~~~~~~~~~~~~~~~~~~
If you are contributing, do not feel the need to sit on your contribution until
it is perfectly polished and complete. It helps everyone involved for you to
@@ -47,7 +52,7 @@ getting that contribution accepted, and can save you from putting a lot of work
into a contribution that is not suitable for the project.
Contribution Suitability
------------------------
~~~~~~~~~~~~~~~~~~~~~~~~
Our project maintainers have the last word on whether or not a contribution is
suitable for Pipenv. All contributions will be considered carefully, but from
@@ -58,29 +63,92 @@ If your contribution is rejected, don't despair! As long as you followed these
guidelines, you will have a much better chance of getting your next
contribution accepted.
Questions
---------
The GitHub issue tracker is for *bug reports* and *feature requests*. Please do
not use it to ask questions about how to use Pipenv. These questions should
instead be directed to `Stack Overflow`_. Make sure that your question is tagged
with the ``pipenv`` tag when asking it on Stack Overflow, to ensure that it is
answered promptly and accurately.
.. _Stack Overflow: https://stackoverflow.com/
Code Contributions
------------------
Steps for Submitting Code
~~~~~~~~~~~~~~~~~~~~~~~~~
When contributing code, you'll want to follow this checklist:
1. Fork the repository on GitHub.
2. `Run the tests`_ to confirm they all pass on your system. If they don't, you'll
need to investigate why they fail. If you're unable to diagnose this
yourself, raise it as a bug report by following the guidelines in this
document: :ref:`bug-reports`.
3. Write tests that demonstrate your bug or feature. Ensure that they fail.
4. Make your change.
5. Run the entire test suite again, confirming that all tests pass *including
#. Understand our `development philosophy`_.
#. Fork the repository on GitHub.
#. Set up your :ref:`dev-setup`
#. Run the tests (:ref:`testing`) to confirm they all pass on your system.
If they don't, you'll need to investigate why they fail. If you're unable
to diagnose this yourself, raise it as a bug report by following the guidelines
in this document: :ref:`bug-reports`.
#. Write tests that demonstrate your bug or feature. Ensure that they fail.
#. Make your change.
#. Run the entire test suite again, confirming that all tests pass *including
the ones you just added*.
6. Send a GitHub Pull Request to the main repository's ``master`` branch.
#. Send a GitHub Pull Request to the main repository's ``master`` branch.
GitHub Pull Requests are the expected method of code collaboration on this
project.
The following sub-sections go into more detail on some of the points above.
.. _development philosophy: https://pipenv.pypa.io/en/latest/dev/philosophy/
.. _dev-setup:
Development Setup
~~~~~~~~~~~~~~~~~
To get your development environment setup, run:
.. code-block:: sh
pip install -e .
pipenv install --dev
This will install the repo version of Pipenv and then install the development
dependencies. Once that has completed, you can start developing.
The repo version of Pipenv must be installed over other global versions to
resolve conflicts with the ``pipenv`` folder being implicitly added to ``sys.path``.
See `pypa/pipenv#2557`_ for more details.
.. _pypa/pipenv#2557: https://github.com/pypa/pipenv/issues/2557
.. _testing:
Testing
~~~~~~~
Tests are written in ``pytest`` style and can be run very simply:
.. code-block:: sh
pytest
This will run all Pipenv tests, which can take awhile. To run a subset of the
tests, the standard pytest filters are available, such as:
- provide a directory or file: ``pytest tests/unit`` or ``pytest tests/unit/test_cmdparse.py``
- provide a keyword expression: ``pytest -k test_lock_editable_vcs_without_install``
- provide a nodeid: ``pytest tests/unit/test_cmdparse.py::test_parse``
- provide a test marker: ``pytest -m lock``
Code Review
~~~~~~~~~~~
@@ -90,6 +158,20 @@ event that you object to the code review feedback, you should make your case
clearly and calmly. If, after doing so, the feedback is judged to still apply,
you must either apply the feedback or withdraw your contribution.
Package Index
~~~~~~~~~~~~~
To speed up testing, tests that rely on a package index for locking and
installing use a local server that contains vendored packages in the
``tests/pypi`` directory. Each vendored package should have it's own folder
containing the necessary releases. When adding a release for a package, it is
easiest to use either the ``.tar.gz`` or universal wheels (ex: ``py2.py3-none``). If
a ``.tar.gz`` or universal wheel is not available, add wheels for all available
architectures and platforms.
Documentation Contributions
---------------------------
@@ -114,13 +196,48 @@ When presenting Python code, use single-quoted strings (``'hello'`` instead of
Bug Reports
-----------
Bug reports are hugely important! Before you raise one, though, please check
through the `GitHub issues`_, **both open and closed**, to confirm that the bug
hasn't been reported before. Duplicate bug reports are a huge drain on the time
of other contributors, and should be avoided as much as possible.
Bug reports are hugely important! They are recorded as `GitHub issues`_. Please
be aware of the following things when filing bug reports:
.. _GitHub issues: https://github.com/pypa/pipenv/issues
1. Avoid raising duplicate issues. *Please* use the GitHub issue search feature
to check whether your bug report or feature request has been mentioned in
the past. Duplicate bug reports and feature requests are a huge maintenance
burden on the limited resources of the project. If it is clear from your
report that you would have struggled to find the original, that's ok, but
if searching for a selection of words in your issue title would have found
the duplicate then the issue will likely be closed extremely abruptly.
2. When filing bug reports about exceptions or tracebacks, please include the
*complete* traceback. Partial tracebacks, or just the exception text, are
not helpful. Issues that do not contain complete tracebacks may be closed
without warning.
3. Make sure you provide a suitable amount of information to work with. This
means you should provide:
- Guidance on **how to reproduce the issue**. Ideally, this should be a
*small* code sample that can be run immediately by the maintainers.
Failing that, let us know what you're doing, how often it happens, what
environment you're using, etc. Be thorough: it prevents us needing to ask
further questions.
- Tell us **what you expected to happen**. When we run your example code,
what are we expecting to happen? What does "success" look like for your
code?
- Tell us **what actually happens**. It's not helpful for you to say "it
doesn't work" or "it fails". Tell us *how* it fails: do you get an
exception? A hang? The packages installed seem incorrect?
How was the actual result different from your expected result?
- Tell us **what version of Pipenv you're using**, and
**how you installed it**. Different versions of Pipenv behave
differently and have different bugs, and some distributors of Pipenv
ship patches on top of the code we supply.
If you do not provide all of these things, it will take us much longer to
fix your problem. If we ask you to clarify these and you never respond, we
will close your issue without fixing it.
.. _run-the-tests:
Run the tests
-------------
@@ -128,10 +245,15 @@ Three ways of running the tests are as follows:
1. ``make test`` (which uses ``docker``)
2. ``./run-tests.sh`` or ``run-tests.bat``
3. Using pipenv::
3. Using pipenv:
pipenv install --dev
pipenv run pytest
.. code-block:: console
$ git clone https://github.com/pypa/pipenv.git
$ cd pipenv
$ git submodule sync && git submodule update --init --recursive
$ pipenv install --dev
$ pipenv run pytest
For the last two, it is important that your environment is setup correctly, and
this may take some work, for example, on a specific Mac installation, the following
+2
View File
@@ -7,6 +7,8 @@ Pipenv is an open but opinionated tool, created by an open but opinionated devel
Management Style
~~~~~~~~~~~~~~~~
**To be updated (as of March 2020)**.
`Kenneth Reitz <http://kennethreitz.org>`__ is the BDFL. He has final say in any decision related to the Pipenv project. Kenneth is responsible for the direction and form of the library, as well as its presentation. In addition to making decisions based on technical merit, he is responsible for making decisions based on the development philosophy of Pipenv.
`Dan Ryan <http://github.com/techalchemy>`__, `Tzu-ping Chung <https://github.com/uranusjr>`__, and `Nate Prewitt <https://github.com/nateprewitt>`__ are the core contributors.
+6 -16
View File
@@ -15,9 +15,6 @@ Pipenv: Python Dev Workflow for Humans
.. image:: https://img.shields.io/pypi/pyversions/pipenv.svg
:target: https://pypi.python.org/pypi/pipenv
.. image:: https://img.shields.io/badge/Say%20Thanks!-🦉-1EAEDB.svg
:target: https://saythanks.io/to/kennethreitz
---------------
**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.*
@@ -26,9 +23,11 @@ It automatically creates and manages a virtualenv for your projects, as well as
Pipenv is primarily meant to provide users and developers of applications with an easy method to setup a working environment. For the distinction between libraries and applications and the usage of ``setup.py`` vs ``Pipfile`` to define dependencies, see :ref:`pipfile-vs-setuppy`.
.. raw:: html
<iframe src="https://player.vimeo.com/video/233134524" width="700" height="460" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
.. image:: https://gist.githubusercontent.com/jlusk/855d611bbcfa2b159839db73d07f6ce9/raw/7f5743401809f7e630ee8ff458faa980e19924a0/pipenv.gif
:height: 341px
:width: 654px
:scale: 100 %
:alt: a short animation of pipenv at work
The problems that Pipenv seeks to solve are multi-faceted:
@@ -70,9 +69,6 @@ Otherwise, refer to the :ref:`installing-pipenv` chapter for instructions.
User Testimonials
-----------------
**Jannis Leidel**, former pip maintainer—
*Pipenv is the porcelain I always wanted to build for pip. It fits my brain and mostly replaces virtualenvwrapper and manual pip calls for me. Use it.*
**David Gang**
*This package manager is really awesome. For the first time I know exactly what my dependencies are which I installed and what the transitive dependencies are. Combined with the fact that installs are deterministic, makes this package manager first class, like cargo*.
@@ -121,6 +117,7 @@ Further Documentation Guides
basics
advanced
cli
diagnose
Contribution Guides
@@ -132,13 +129,6 @@ Contribution Guides
dev/philosophy
dev/contributing
☤ Pipenv Usage
--------------
.. click:: pipenv:cli
:prog: pipenv
:show-nested:
Indices and tables
==================
+2 -2
View File
@@ -146,7 +146,7 @@ To upgrade pipenv at any time::
If you don't even have pip installed, you can use this crude installation method, which will bootstrap your whole system::
$ curl https://raw.githubusercontent.com/kennethreitz/pipenv/master/get-pipenv.py | python
$ curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
☤ Installing packages for your project
@@ -223,7 +223,7 @@ have access to your installed packages with ``$ pipenv shell``.
☤ Virtualenv mapping caveat
============
===========================
- Pipenv automatically maps projects to their specific virtualenvs.
- The virtualenv is stored globally with the name of the projects root directory plus the hash of the full path to the project's root (e.g., ``my_project-a3de50``).
+1
View File
@@ -0,0 +1 @@
Added documenation about variable expansion in ``Pipfile`` entries.
+1
View File
@@ -0,0 +1 @@
Make conservative checks of known exceptions when subprocess returns output, so user won't see the whole traceback - just the error.
+1
View File
@@ -0,0 +1 @@
Fixed a bug which caused editable package resolution to sometimes fail with an unhelpful setuptools-related error message.
+2
View File
@@ -0,0 +1,2 @@
Fixed an issue which caused errors due to reliance on the system utilities ``which`` and ``where`` which may not always exist on some systems.
- Fixed a bug which caused periodic failures in python discovery when executables named ``python`` were not present on the target ``$PATH``.
+1
View File
@@ -0,0 +1 @@
Dependency resolution now writes hashes for local and remote files to the lockfile.
+1
View File
@@ -0,0 +1 @@
Fixed a bug which prevented ``pipenv graph`` from correctly showing all dependencies when running from within ``pipenv shell``.
+1
View File
@@ -0,0 +1 @@
Consolidate all contributing docs in the rst file
+1
View File
@@ -0,0 +1 @@
Fixed resolution of direct-url dependencies in ``setup.py`` files to respect ``PEP-508`` style URL dependencies.
+1
View File
@@ -0,0 +1 @@
Added support for resolution of direct-url dependencies in ``setup.py`` files to respect ``PEP-508`` style URL dependencies.
+1
View File
@@ -0,0 +1 @@
Update the out-dated manual page.
+1
View File
@@ -0,0 +1 @@
Update pytest-pypi documentation not to be pytest-httpbin documentation.
+3
View File
@@ -0,0 +1,3 @@
Fixed a bug which caused failures in warning reporting when running pipenv inside a virtualenv under some circumstances.
- Fixed a bug with package discovery when running ``pipenv clean``.
+5
View File
@@ -0,0 +1,5 @@
Added full support for resolution of all dependency types including direct URLs, zip archives, tarballs, etc.
- Improved error handling and formatting.
- Introduced improved cross platform stream wrappers for better ``stdout`` and ``stderr`` consistency.
+34
View File
@@ -0,0 +1,34 @@
Updated vendored dependencies:
- **attrs**: ``18.2.0`` => ``19.1.0``
- **certifi**: ``2018.10.15`` => ``2019.3.9``
- **cached_property**: ``1.4.3`` => ``1.5.1``
- **cerberus**: ``1.2.0`` => ``1.3.1``
- **click-completion**: ``0.5.0`` => ``0.5.1``
- **colorama**: ``0.3.9`` => ``0.4.1``
- **distlib**: ``0.2.8`` => ``0.2.9``
- **idna**: ``2.7`` => ``2.8``
- **jinja2**: ``2.10.0`` => ``2.10.1``
- **markupsafe**: ``1.0`` => ``1.1.1``
- **orderedmultidict**: ``(new)`` => ``1.0``
- **packaging**: ``18.0`` => ``19.0``
- **parse**: ``1.9.0`` => ``1.12.0``
- **pathlib2**: ``2.3.2`` => ``2.3.3``
- **pep517**: ``(new)`` => ``0.5.0``
- **pexpect**: ``4.6.0`` => ``4.7.0``
- **pipdeptree**: ``0.13.0`` => ``0.13.2``
- **pyparsing**: ``2.2.2`` => ``2.3.1``
- **python-dotenv**: ``0.9.1`` => ``0.10.2``
- **pythonfinder**: ``1.1.10`` => ``1.2.1``
- **pytoml**: ``(new)`` => ``0.1.20``
- **requests**: ``2.20.1`` => ``2.21.0``
- **requirementslib**: ``1.3.3`` => ``1.5.0``
- **scandir**: ``1.9.0`` => ``1.10.0``
- **shellingham**: ``1.2.7`` => ``1.3.1``
- **six**: ``1.11.0`` => ``1.12.0``
- **tomlkit**: ``0.5.2`` => ``0.5.3``
- **urllib3**: ``1.24`` => ``1.25.2``
- **vistir**: ``0.3.0`` => ``0.4.1``
- **yaspin**: ``0.14.0`` => ``0.14.3``
- Removed vendored dependency **cursor**.
+1
View File
@@ -0,0 +1 @@
Pipenv will now successfully recursively lock VCS sub-dependencies.
+1
View File
@@ -0,0 +1 @@
Fix a bug where custom virtualenv can not be activated with pipenv shell
+1
View File
@@ -0,0 +1 @@
Move CLI docs to its own page.
+1
View File
@@ -0,0 +1 @@
Fix a bug where pipenv --clear is not working
+1
View File
@@ -0,0 +1 @@
Pipenv will now discover and resolve the intrinsic dependencies of **all** VCS dependencies, whether they are editable or not, to prevent resolution conflicts.
+1
View File
@@ -0,0 +1 @@
Do not touch Pipfile early and rely on it so that one can do ``pipenv sync`` without a Pipfile.
+1
View File
@@ -0,0 +1 @@
Fixed a keyerror which could occur when locking VCS dependencies in some cases.
+1 -1
View File
@@ -1 +1 @@
Fix a bug that ``ValidationError`` is thrown when some fields are missing in source section.
Fixed a bug that ``ValidationError`` is thrown when some fields are missing in source section.
+1
View File
@@ -0,0 +1 @@
Improve the error message when one tries to initialize a Pipenv project under ``/``.
+1 -1
View File
@@ -1 +1 @@
Fix the wrong order of old and new hashes in message.
Fixed the wrong order of old and new hashes in message.
+1 -1
View File
@@ -1 +1 @@
Update the index names in lock file when source name in Pipfile is changed.
Updated the index names in lock file when source name in Pipfile is changed.
+1
View File
@@ -0,0 +1 @@
Fixed an issue which caused ``pipenv install --help`` to show duplicate entries for ``--pre``.
+1
View File
@@ -0,0 +1 @@
Replace (non-existant) video on docs index.rst with equivalent gif.
+1
View File
@@ -0,0 +1 @@
Fix bug causing ``[SSL: CERTIFICATE_VERIFY_FAILED]`` when Pipfile ``[[source]]`` has verify_ssl=false and url with custom port.
+1
View File
@@ -0,0 +1 @@
Clarify wording in Basic Usage example on using double quotes to escape shell redirection
+1
View File
@@ -0,0 +1 @@
Ensure docs show navigation on small-screen devices
+1
View File
@@ -0,0 +1 @@
Fix ``sync --sequential`` ignoring ``pip install`` errors and logs.
+1
View File
@@ -0,0 +1 @@
Added a new environment variable, ``PIPENV_RESOLVE_VCS``, to toggle dependency resolution off for non-editable VCS, file, and URL based dependencies.
+1
View File
@@ -0,0 +1 @@
Fix the issue that lock file can't be created when ``PIPENV_PIPFILE`` is not under working directory.
+1
View File
@@ -0,0 +1 @@
Added the ability for Windows users to enable emojis by setting ``PIPENV_HIDE_EMOJIS=0``.
+1
View File
@@ -0,0 +1 @@
Removed unused vendored package shutilwhich
+1
View File
@@ -0,0 +1 @@
Added a link to the TOML Spec under General Recommendations & Version Control to clarify how Pipfiles should be written.
+1
View File
@@ -0,0 +1 @@
Removed unused vendored package blindspin
+1
View File
@@ -0,0 +1 @@
Use tablib instead of requests in tests to avoid failures when vendored
+1
View File
@@ -0,0 +1 @@
Pipenv will no longer inadvertently set ``editable=True`` on all vcs dependencies.
+1
View File
@@ -0,0 +1 @@
Allow overriding PIPENV_INSTALL_TIMEOUT environment variable (in seconds).
+2
View File
@@ -0,0 +1,2 @@
The ``--keep-outdated`` argument to ``pipenv install`` and ``pipenv lock`` will now drop specifier constraints when encountering editable dependencies.
- In addition, ``--keep-outdated`` will retain specifiers that would otherwise be dropped from any entries that have not been updated.
+1
View File
@@ -0,0 +1 @@
Allow KeyboardInterrupt to cancel test suite checks for working internet and ssh
+1
View File
@@ -0,0 +1 @@
Cleaned up some conditional logic that would always evaluate ``True``.
+1
View File
@@ -0,0 +1 @@
Add installation instructions for Debian Buster+ in README
+1
View File
@@ -0,0 +1 @@
Fixed a bug which sometimes caused pipenv to fail to respect the ``--site-packages`` flag when passed with ``pipenv install``.
+1
View File
@@ -0,0 +1 @@
Update pytest configuration to support pytest 4.
+3
View File
@@ -0,0 +1,3 @@
Allow overriding PIP_EXISTS_ACTION evironment variable (value is passed to pip install).
Possible values here: https://pip.pypa.io/en/stable/reference/pip/#exists-action-option
Useful when you need to `PIP_EXISTS_ACTION=i` (ignore existing packages) - great for CI environments, where you need really fast setup.
+1
View File
@@ -0,0 +1 @@
Normalize the package names to lowercase when comparing used and in-Pipfile packages.
+1
View File
@@ -0,0 +1 @@
Improve the error message of ``pipenv --py`` when virtualenv can't be found.
+1
View File
@@ -0,0 +1 @@
Updated the documentation with the new ``pytest`` entrypoint.
+1
View File
@@ -0,0 +1 @@
Pipenv will no longer forcibly override ``PIP_NO_DEPS`` on all vcs and file dependencies as resolution happens on these in a pre-lock step.
+1
View File
@@ -0,0 +1 @@
``pipenv update --outdated`` will now correctly handle comparisons between pre/post-releases and normal releases.
+1
View File
@@ -0,0 +1 @@
Updated ``pip_shims`` to support ``--outdated`` with new pip versions.
+1
View File
@@ -0,0 +1 @@
Fixed a ``KeyError`` which could occur when pinning outdated VCS dependencies via ``pipenv lock --keep-outdated``.
+1
View File
@@ -0,0 +1 @@
Resolved an issue which caused resolution to fail when encountering poorly formatted ``python_version`` markers in ``setup.py`` and ``setup.cfg`` files.

Some files were not shown because too many files have changed in this diff Show More