Skip to content

Commit d5f461d

Browse files
committed
don't build for python 2.7
Signed-off-by: oleg.hoefling <[email protected]>
1 parent b7e9408 commit d5f461d

File tree

5 files changed

+16
-46
lines changed

5 files changed

+16
-46
lines changed

.appveyor.yml

Lines changed: 0 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

.github/workflows/manylinux2010.yml

Lines changed: 1 addition & 1 deletion
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

.travis.yml

Lines changed: 0 additions & 1 deletion
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

setup.py

Lines changed: 14 additions & 41 deletions
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)