Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Commit

Permalink
Require enum34 only under Python 2.7
Browse files Browse the repository at this point in the history
It seems like Ubuntu trusty's version of pip
does in fact support environment markers.
At least it works for mitmproxy:
https://github.com/mitmproxy/mitmproxy/blob/deb7844/setup.py#L93-L98

I assume it will also work in Debian 8 "jessie"
which has even newer python-{pip,setuptools} than trusty.
  • Loading branch information
vfaronov committed Aug 13, 2016
1 parent c4b63b3 commit 9eca1a0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 29 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include requirements.in
include setup.cfg

include README.rst
Expand Down
20 changes: 0 additions & 20 deletions requirements.in

This file was deleted.

22 changes: 17 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
with io.open('README.rst') as f:
long_description = f.read()

with io.open('requirements.in') as f:
install_requires = [line for line in f
if line and not line.startswith('#')]


setup(
name='HTTPolice',
Expand All @@ -27,7 +23,23 @@
author='Vasiliy Faronov',
author_email='vfaronov@gmail.com',
license='MIT',
install_requires=install_requires,

# XXX: when updating these fields,
# make sure you don't break ``tools/minimum_requires.sh``.
install_requires=[
'singledispatch >= 3.4.0.3',
'six >= 1.10.0',
'lxml >= 3.6.0',
'bitstring >= 3.1.4',
'dominate >= 2.2.0',
'defusedxml >= 0.4.1',
],
extras_require={
':python_version == "2.7"': [
'enum34 >= 1.1.6',
],
},

packages=[
'httpolice',
'httpolice.inputs',
Expand Down
7 changes: 4 additions & 3 deletions tools/minimum_requires.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/sh

# Install the lowest versions of requirements permitted by HTTPolice.
# This checks that these lower bounds are up-to-date.
# Install the lowest versions of requirements permitted by HTTPolice,
# so we can ensure that these lower bounds are up-to-date.

set -e

test -e setup.py || { echo 'must run from repo root' >&2; exit 1; }

sed -e 's/>=/==/g' <requirements.in >minimum_requirements.txt
grep -Eo '[A-Za-z0-9_.]+ >= [A-Za-z0-9_.]+' setup.py | \
sed -e 's/>=/==/g' >minimum_requirements.txt
pip install -r minimum_requirements.txt

0 comments on commit 9eca1a0

Please sign in to comment.