Skip to content

Commit

Permalink
Remove python 3.5 wheels (#253)
Browse files Browse the repository at this point in the history
* Remove python3.5 EOL wheels

* Build manywheels only for python3.[6-9]

* Fix manywheels build
  • Loading branch information
SzabolcsGergely authored Sep 7, 2021
1 parent 0013296 commit da39a0d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8, 3.9]
python-architecture: [x64, x86]
steps:
- name: Cache .hunter folder
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- name: Cache .hunter folder
uses: actions/cache@v2
Expand Down Expand Up @@ -259,7 +259,7 @@ jobs:
/opt/python/cp38-cp38/bin/python3.8 setup.py sdist --formats=gztar
mv dist/* wheelhouse/audited/
- name: Build wheels
run: for PYBIN in /opt/python/cp3*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
run: for PYBIN in /opt/python/cp3{6..9}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
- name: Audit wheels
run: for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat $PLAT -w wheelhouse/audited/; done
- name: Archive wheel artifacts
Expand Down Expand Up @@ -316,7 +316,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v') != true
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
- name: Building wheels
run: for PYBIN in /opt/python/cp3*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
run: for PYBIN in /opt/python/cp3{6..9}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
- name: Auditing wheels
run: for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat $PLAT -w wheelhouse/audited/; done
- name: Archive wheel artifacts
Expand Down
2 changes: 1 addition & 1 deletion ci/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ yum install -y libusb1-devel
#yum remove -y libusb1

# Compile wheels
for PYBIN in /opt/python/cp3*/bin; do
for PYBIN in /opt/python/cp3{6..9}*/bin; do
#"${PYBIN}/pip" install -r /io/requirements.txt
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
done
Expand Down
15 changes: 7 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
here = os.path.abspath(os.path.dirname(__file__))
version_file = os.path.join(here, "generated", "version.py")
os.makedirs(os.path.join(here, "generated"), exist_ok=True)
if os.environ.get('CI') != None :
if os.environ.get('CI') != None :
### If CI build, respect 'BUILD_COMMIT_HASH' to determine final version if set
final_version = find_version.get_package_version()
if os.environ.get('BUILD_COMMIT_HASH') != None:
Expand Down Expand Up @@ -67,7 +67,7 @@ def __init__(self, name, sourcedir=''):


class CMakeBuild(build_ext):

def run(self):
try:
out = subprocess.check_output(['cmake', '--version'])
Expand Down Expand Up @@ -133,13 +133,13 @@ def build_extension(self, ext):
if platform.system() == "Windows":
cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)]
cmake_args += ['-DCMAKE_TOOLCHAIN_FILE={}'.format(os.path.dirname(os.path.abspath(__file__)) + '/cmake/toolchain/msvc.cmake')]

# Detect whether 32 / 64 bit Python is used and compile accordingly
if sys.maxsize > 2**32:
cmake_args += ['-A', 'x64']
else:
cmake_args += ['-A', 'Win32']

# Add flag to build with maximum available threads
build_args += ['--', '/m']
# Unix
Expand All @@ -155,13 +155,13 @@ def build_extension(self, ext):
num_threads = (freeMemory // 1000)
num_threads = min(num_threads, max_threads)
if num_threads <= 0:
num_threads = 1
num_threads = 1
build_args += ['--', '-j' + str(num_threads)]
cmake_args += ['-DHUNTER_JOBS_NUMBER=' + str(num_threads)]

env = os.environ.copy()
env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''), self.distribution.get_version())

# Add additional cmake args from environment
if 'CMAKE_ARGS' in os.environ:
cmake_args += [os.environ['CMAKE_ARGS']]
Expand Down Expand Up @@ -200,7 +200,6 @@ def build_extension(self, ext):
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand All @@ -210,5 +209,5 @@ def build_extension(self, ext):
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
],
python_requires='>=3.5',
python_requires='>=3.6',
)

0 comments on commit da39a0d

Please sign in to comment.