Skip to content

Commit e5e3fec

Browse files
committed
Use pip-tools
1 parent c4fc79d commit e5e3fec

File tree

6 files changed

+84
-94
lines changed

6 files changed

+84
-94
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ python:
66
- nightly
77
- pypy3
88
install:
9-
- pip install -U 'setuptools>=18.5' 'pip>=6.0'
9+
- pip install -U 'setuptools>=18.5' 'pip>=6.0' 'wheel'
1010
# Need to install pyperformance,
1111
# pyperformance/tests/test_compare.py imports it
1212
- pip install -e .

doc/changelog.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ Version 1.0.1
88
with Python 3.
99
* Update dependencies:
1010

11-
* Django: 3.0 => 3.0.2
11+
* Django: 3.0 => 3.0.3
1212
* Mako: 1.1.0 = > 1.1.1
1313
* SQLAlchemy: 1.3.12 => 1.3.13
1414
* dulwich: 0.19.14 => 0.19.15
15-
* mercurial: 5.1.1 => 5.2.2
15+
* mercurial: 5.1.1 => 5.3
1616
* six : 1.13.0 => 1.14.0
1717
* sympy: 1.5 => 1.5.1
1818

19+
* pip-tools (pip-compile) is now used to update dependencies
20+
1921
Version 1.0.0 (2019-12-17)
2022
--------------------------
2123

pyperformance/requirements.in

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# pyperformance dependencies
2+
# --------------------------
3+
4+
six==1.14.0
5+
pyperf==1.7.0
6+
7+
8+
# Benchmarks dependencies
9+
# -----------------------
10+
#
11+
# When one of these dependencies is upgraded, the pyperformance major version
12+
# should be increased to respect semantic versionning. Comparison between
13+
# two pyperformance results of two different major versions is not reliable.
14+
15+
Chameleon # bm_chameleon
16+
Django # bm_django_template
17+
Genshi # bm_genshi
18+
Mako # bm_mako
19+
SQLAlchemy # bm_sqlalchemy_declarative
20+
mercurial # bm_hg_startup
21+
html5lib # bm_html5lib
22+
pyaes # bm_crypto_pyaes
23+
sympy # bm_sympy
24+
tornado # bm_tornado_http
25+
26+
27+
# Optional dependencies
28+
# ---------------------
29+
#
30+
# The list of optional dependencies is hardcoded in pyperformance/venv.py
31+
32+
psutil
33+
dulwich # bm_dulwich_log

pyperformance/requirements.txt

Lines changed: 24 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,28 @@
1-
# Installer requirements
2-
# ----------------------
31
#
4-
# The list of installer requirements is hardcoded in pyperformance/venv.py
2+
# This file is autogenerated by pip-compile
3+
# To update, run:
54
#
6-
# Note: installer requirements are also used in .travis.yml
7-
8-
# html5lib requires setuptools 18.5 or newer
9-
setuptools>=18.5
10-
# pip 6 is the first version supporting environment markers
11-
pip>=6.0
12-
# install wheel so pip can cache binary wheel packages locally,
13-
# and install prebuilt wheel packages from PyPI
14-
wheel
15-
16-
17-
# Indirect dependencies
18-
# ---------------------
5+
# pip-compile requirements.in
196
#
20-
# Freeze indirect dependencies to get a more reproductible test environment
21-
22-
# tornado 4.4.1 dependencies
23-
backports-abc==0.5
24-
singledispatch==3.4.0.3
25-
certifi==2019.11.28
26-
27-
# Mako 1.0.4 dependencies
28-
MarkupSafe==1.1.1
29-
30-
# html5lib 0.999999999 dependencies
31-
webencodings==0.5.1
32-
33-
# sympy 1.0 dependency
34-
mpmath==1.1.0
35-
36-
37-
# pyperformance dependencies
38-
# --------------------------
39-
40-
six==1.14.0
41-
pyperf==1.7.0
42-
43-
44-
# Benchmarks dependencies
45-
# -----------------------
46-
#
47-
# When one of these dependencies is upgraded, the pyperformance major version
48-
# should be increased to respect semantic versionning. Comparison between
49-
# two pyperformance results of two different major versions is not reliable.
50-
51-
Chameleon==3.6.2 # bm_chameleon
52-
Django==3.0.3 # bm_django_template
53-
Genshi==0.7.3 # bm_genshi
54-
Mako==1.1.1 # bm_mako
55-
SQLAlchemy==1.3.13 # bm_sqlalchemy_declarative
56-
dulwich==0.19.15 # dulwich_log
57-
mercurial==5.2.2 # bm_hg_startup
58-
html5lib==1.0.1 # bm_html5lib
59-
pyaes==1.6.1 # bm_crypto_pyaes
60-
sympy==1.5.1 # bm_sympy
61-
tornado==6.0.3 # bm_tornado_http
62-
63-
64-
# Optional dependencies
65-
# ---------------------
66-
#
67-
# The list of optional dependencies is hardcoded in pyperformance/venv.py
68-
7+
asgiref==3.2.3 # via django
8+
certifi==2019.11.28 # via dulwich
9+
chameleon==3.6.2
10+
django==3.0.3
11+
dulwich==0.19.15
12+
genshi==0.7.3
13+
html5lib==1.0.1
14+
mako==1.1.1
15+
markupsafe==1.1.1 # via mako
16+
mercurial==5.3
17+
mpmath==1.1.0 # via sympy
6918
psutil==5.6.7
70-
71-
72-
# pyperformance
73-
# -------------
74-
#
75-
# The pyperformance module is installed inside the virtual environment
76-
# by pyperformance/venv.py
19+
pyaes==1.6.1
20+
pyperf==1.7.0
21+
pytz==2019.3 # via django
22+
six==1.14.0
23+
sqlalchemy==1.3.13
24+
sqlparse==0.3.0 # via django
25+
sympy==1.5.1
26+
tornado==6.0.3
27+
urllib3==1.25.8 # via dulwich
28+
webencodings==0.5.1 # via html5lib

pyperformance/venv.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,24 @@ def is_build_dir():
105105

106106

107107
class Requirements(object):
108-
def __init__(self, filename, pip, installer, optional):
109-
# pip requirement
110-
self.pip = []
111-
112-
# pre-requirements (setuptools, pip)
113-
self.installer = []
108+
def __init__(self, filename, optional):
109+
# if pip or setuptools is updated:
110+
# .travis.yml should be updated as well
111+
112+
# pip requirements
113+
self.pip = [
114+
# pip 6 is the first version supporting environment markers
115+
'pip>=6.0',
116+
]
117+
118+
# installer requirements
119+
self.installer = [
120+
# html5lib requires setuptools 18.5 or newer
121+
'setuptools>=18.5',
122+
# install wheel so pip can cache binary wheel packages locally,
123+
# and install prebuilt wheel packages from PyPI
124+
'wheel',
125+
]
114126

115127
# requirements
116128
self.req = []
@@ -133,11 +145,7 @@ def __init__(self, filename, pip, installer, optional):
133145
req = req.partition('==')[0]
134146
req = req.partition('>=')[0]
135147

136-
if req in pip:
137-
self.pip.append(line)
138-
elif req in installer:
139-
self.installer.append(line)
140-
elif req in optional:
148+
if req in optional:
141149
self.optional.append(line)
142150
else:
143151
self.req.append(line)
@@ -473,8 +481,6 @@ def _install_req(self):
473481
filename = os.path.join(PERFORMANCE_ROOT, 'requirements.txt')
474482
requirements = Requirements(filename,
475483
# FIXME: don't hardcode requirements
476-
['pip', 'setuptools'],
477-
['wheel'],
478484
['psutil', 'dulwich'])
479485

480486
# Upgrade pip

setup.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@
66
#
77
# Update dependencies:
88
#
9+
# - python3 -m pip install --user --upgrade pip-tools
910
# - git clean -fdx # remove all untracked files!
10-
# - python3 -m pyperformance venv create
11-
# - venv/cpython*/bin/python -m pip list --outdated
12-
# - update pyperformance/requirements.txt
13-
# - (see also pip-tools and pipdeptree tools)
14-
# - (pip install pip-review; pip-review --local --interactive)
11+
# - cd pyperformance; pip-compile requirements.in
1512
#
1613
# Prepare a release:
1714
#
@@ -20,7 +17,7 @@
2017
# - maybe update version in pyperformance/__init__.py and doc/conf.py
2118
# - set release date in doc/changelog.rst
2219
# - git commit -a -m "prepare release x.y"
23-
# - run tests: tox
20+
# - run tests: tox --parallel 0
2421
# - git push
2522
# - check Travis CI status:
2623
# https://travis-ci.org/python/pyperformance

0 commit comments

Comments
 (0)