Skip to content

Commit 7bbeed4

Browse files
authored
Merge pull request #167 from hoefling/py27-eol
End Python 2.7 support
2 parents 6ed9d42 + c147027 commit 7bbeed4

File tree

5 files changed

+33
-63
lines changed

5 files changed

+33
-63
lines changed

.appveyor.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
environment:
22
matrix:
3-
- python: 27
4-
- python: 27-x64
53
- python: 35
64
- python: 35-x64
75
- python: 36

.github/workflows/macosx.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: macos-latest
66
strategy:
77
matrix:
8-
python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
8+
python: [3.5, 3.6, 3.7, 3.8, 3.9]
99
steps:
1010
- uses: actions/checkout@v1
1111
- name: Setup Python
@@ -17,28 +17,28 @@ jobs:
1717
pip install --upgrade pip setuptools wheel
1818
brew install libxml2 libxmlsec1 pkg-config
1919
- name: Build macosx_x86_64 wheel
20+
env:
21+
CC: clang
22+
CFLAGS: "-fprofile-instr-generate -fcoverage-mapping"
23+
LDFLAGS: "-fprofile-instr-generate -fcoverage-mapping"
2024
run: |
2125
python setup.py bdist_wheel
26+
rm -rf build/
2227
- name: Set environment variables
2328
shell: bash
2429
run: |
25-
echo ::set-env name=PKGVER::$(python setup.py --version)
26-
echo ::set-env name=LLVM_PROFILE_FILE::"pyxmlsec-%p.profraw"
30+
echo "PKGVER=$(python setup.py --version)" >> $GITHUB_ENV
31+
echo "LLVM_PROFILE_FILE=pyxmlsec.profraw" >> $GITHUB_ENV
2732
- name: Install test dependencies
28-
env:
29-
CC: clang
30-
CFLAGS: "-fprofile-instr-generate -fcoverage-mapping"
31-
LDFLAGS: "-fprofile-instr-generate -fcoverage-mapping"
3233
run: |
33-
rm -rf build/
3434
pip install coverage --upgrade -r requirements-test.txt
35-
pip install --editable .
35+
pip install xmlsec --only-binary=xmlsec --no-index --find-links=dist/
36+
echo "PYXMLSEC_LIBFILE=$(python -c 'import xmlsec; print(xmlsec.__file__)')" >> $GITHUB_ENV
3637
- name: Run tests
3738
run: |
3839
coverage run -m pytest -v --color=yes
3940
- name: Report coverage to codecov
4041
run: |
41-
LIBFILE=$(python -c "import xmlsec; print(xmlsec.__file__)")
42-
/Library/Developer/CommandLineTools/usr/bin/llvm-profdata merge -sparse pyxmlsec-*.profraw -output pyxmlsec.profdata
43-
/Library/Developer/CommandLineTools/usr/bin/llvm-cov show ${LIBFILE} -instr-profile=pyxmlsec.profdata src > coverage.txt
42+
/Library/Developer/CommandLineTools/usr/bin/llvm-profdata merge -sparse ${{ env.LLVM_PROFILE_FILE }} -output pyxmlsec.profdata
43+
/Library/Developer/CommandLineTools/usr/bin/llvm-cov show ${{ env.PYXMLSEC_LIBFILE }} -instr-profile=pyxmlsec.profdata src > coverage.txt
4444
bash <(curl -s https://codecov.io/bash) -f coverage.txt

.github/workflows/manylinux2010.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
container: quay.io/pypa/manylinux2010_x86_64
77
strategy:
88
matrix:
9-
python-abi: [cp27-cp27m, cp27-cp27mu, cp35-cp35m, cp36-cp36m, cp37-cp37m, cp38-cp38, cp39-cp39]
9+
python-abi: [cp35-cp35m, cp36-cp36m, cp37-cp37m, cp38-cp38, cp39-cp39]
1010
steps:
1111
- uses: actions/checkout@v1
1212
- name: Install build dependencies
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set environment variables
1616
shell: bash
1717
run: |
18-
echo ::set-env name=PKGVER::$(/opt/python/${{ matrix.python-abi }}/bin/python setup.py --version)
18+
echo "PKGVER=$(/opt/python/${{ matrix.python-abi }}/bin/python setup.py --version)" >> $GITHUB_ENV
1919
- name: Build linux_x86_64 wheel
2020
env:
2121
PYXMLSEC_STATIC_DEPS: true
@@ -24,10 +24,10 @@ jobs:
2424
- name: Label manylinux2010_x86_64 wheel
2525
run: |
2626
ls -la dist/
27-
auditwheel show dist/xmlsec-${PKGVER}-${{ matrix.python-abi }}-linux_x86_64.whl
28-
auditwheel repair dist/xmlsec-${PKGVER}-${{ matrix.python-abi }}-linux_x86_64.whl
27+
auditwheel show dist/xmlsec-${{ env.PKGVER }}-${{ matrix.python-abi }}-linux_x86_64.whl
28+
auditwheel repair dist/xmlsec-${{ env.PKGVER }}-${{ matrix.python-abi }}-linux_x86_64.whl
2929
ls -l wheelhouse/
30-
auditwheel show wheelhouse/xmlsec-${PKGVER}-${{ matrix.python-abi }}-manylinux2010_x86_64.whl
30+
auditwheel show wheelhouse/xmlsec-${{ env.PKGVER }}-${{ matrix.python-abi }}-manylinux2010_x86_64.whl
3131
- name: Install test dependencies
3232
run: |
3333
/opt/python/${{ matrix.python-abi }}/bin/pip install --upgrade -r requirements-test.txt

.travis.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ notifications:
55
email: false
66
matrix:
77
include:
8-
- python: 2.7
98
- python: 3.5
109
- python: 3.6
1110
- python: 3.7
@@ -36,8 +35,8 @@ addons:
3635
install:
3736
- travis_retry pip install --upgrade pip setuptools wheel
3837
- travis_retry pip install coverage -r requirements-test.txt --upgrade --force-reinstall
39-
- travis_retry pip install -e "."
40-
- pip list
38+
- python setup.py bdist_wheel
39+
- pip install xmlsec --only-binary=xmlsec --no-index --find-links=dist/
4140
script: coverage run -m pytest -v tests --color=yes
4241
after_success:
4342
- lcov --capture --no-external --directory . --output-file coverage.info

setup.py

+14-41
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,18 @@
77
import zipfile
88
from distutils import log
99
from distutils.errors import DistutilsError
10+
from pathlib import Path
11+
from urllib.request import urlcleanup, urljoin, urlretrieve
1012

1113
from setuptools import Extension, setup
1214
from setuptools.command.build_ext import build_ext as build_ext_orig
1315

14-
if sys.version_info >= (3, 4):
15-
from urllib.request import urlcleanup, urljoin, urlretrieve
16-
else:
17-
from urllib import urlcleanup, urlretrieve
18-
from urlparse import urljoin
19-
2016

2117
class build_ext(build_ext_orig, object):
2218
def info(self, message):
2319
self.announce(message, level=log.INFO)
2420

2521
def run(self):
26-
if sys.version_info >= (3, 4):
27-
from pathlib import Path
28-
else:
29-
from pathlib2 import Path
30-
3122
ext = self.ext_map['xmlsec']
3223
self.debug = os.environ.get('PYXMLSEC_ENABLE_DEBUG', False)
3324
self.static = os.environ.get('PYXMLSEC_STATIC_DEPS', False)
@@ -107,16 +98,10 @@ def run(self):
10798

10899
def prepare_static_build_win(self):
109100
release_url = 'https://github.com/bgaifullin/libxml2-win-binaries/releases/download/v2018.08/'
110-
if sys.version_info < (3, 5):
111-
if sys.maxsize > 2147483647:
112-
suffix = 'vs2008.win64'
113-
else:
114-
suffix = "vs2008.win32"
101+
if sys.maxsize > 2147483647:
102+
suffix = 'win64'
115103
else:
116-
if sys.maxsize > 2147483647:
117-
suffix = "win64"
118-
else:
119-
suffix = "win32"
104+
suffix = 'win32'
120105

121106
libs = [
122107
'libxml2-2.9.4.{}.zip'.format(suffix),
@@ -185,7 +170,7 @@ def prepare_static_build_linux(self):
185170
self.libxml2_version = os.environ.get('PYXMLSEC_LIBXML2_VERSION', None)
186171
self.libxslt_version = os.environ.get('PYXMLSEC_LIBXLST_VERSION', None)
187172
self.zlib_version = os.environ.get('PYXMLSEC_ZLIB_VERSION', '1.2.11')
188-
self.xmlsec1_version = os.environ.get('PYXMLSEC_XMLSEC1_VERSION', '1.2.30')
173+
self.xmlsec1_version = os.environ.get('PYXMLSEC_XMLSEC1_VERSION', '1.2.31')
189174

190175
self.info('Settings:')
191176
self.info('{:20} {}'.format('Lib sources in:', self.libs_dir.absolute()))
@@ -402,26 +387,11 @@ def prepare_static_build_linux(self):
402387
ext.extra_objects = [str(self.prefix_dir / 'lib' / o) for o in extra_objects]
403388

404389

405-
if sys.version_info >= (3, 4):
406-
from pathlib import Path
407-
408-
src_root = Path(__file__).parent / 'src'
409-
sources = [str(p.absolute()) for p in src_root.rglob('*.c')]
410-
else:
411-
import fnmatch
412-
413-
src_root = os.path.join(os.path.dirname(__file__), 'src')
414-
sources = []
415-
for root, _, files in os.walk(src_root):
416-
for file in fnmatch.filter(files, '*.c'):
417-
sources.append(os.path.join(root, file))
418-
390+
src_root = Path(__file__).parent / 'src'
391+
sources = [str(p.absolute()) for p in src_root.rglob('*.c')]
419392
pyxmlsec = Extension('xmlsec', sources=sources)
420393
setup_reqs = ['setuptools_scm[toml]>=3.4', 'pkgconfig>=1.5.1', 'lxml>=3.8']
421394

422-
if sys.version_info < (3, 4):
423-
setup_reqs.append('pathlib2')
424-
425395

426396
with io.open('README.rst', encoding='utf-8') as f:
427397
long_desc = f.read()
@@ -434,15 +404,18 @@ def prepare_static_build_linux(self):
434404
long_description=long_desc,
435405
ext_modules=[pyxmlsec],
436406
cmdclass={'build_ext': build_ext},
437-
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
407+
python_requires='>=3.5',
438408
setup_requires=setup_reqs,
439409
install_requires=['lxml>=3.8'],
440410
author="Bulat Gaifullin",
441411
author_email='[email protected]',
442412
maintainer='Oleg Hoefling',
443413
maintainer_email='[email protected]',
444414
url='https://github.com/mehcode/python-xmlsec',
445-
project_urls={'Documentation': 'https://xmlsec.readthedocs.io', 'Source': 'https://github.com/mehcode/python-xmlsec',},
415+
project_urls={
416+
'Documentation': 'https://xmlsec.readthedocs.io',
417+
'Source': 'https://github.com/mehcode/python-xmlsec',
418+
},
446419
license='MIT',
447420
keywords=['xmlsec'],
448421
classifiers=[
@@ -452,12 +425,12 @@ def prepare_static_build_linux(self):
452425
'License :: OSI Approved :: MIT License',
453426
'Operating System :: OS Independent',
454427
'Programming Language :: C',
455-
'Programming Language :: Python :: 2.7',
456428
'Programming Language :: Python :: 3',
457429
'Programming Language :: Python :: 3.5',
458430
'Programming Language :: Python :: 3.6',
459431
'Programming Language :: Python :: 3.7',
460432
'Programming Language :: Python :: 3.8',
433+
'Programming Language :: Python :: 3.9',
461434
'Topic :: Text Processing :: Markup :: XML',
462435
'Typing :: Typed',
463436
],

0 commit comments

Comments
 (0)