From 84fe9d2219e8c77f8901bfb9ee538800224f498b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Rast?= Date: Sat, 5 Oct 2019 19:22:33 +0200 Subject: [PATCH] Don't upload bare linux wheels, fixed long description --- ci/build-wheels.sh | 2 ++ ci/download_release_files.py | 24 ++++++++++++++++++++++++ setup.py | 11 ++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 ci/download_release_files.py diff --git a/ci/build-wheels.sh b/ci/build-wheels.sh index bef24f5..bd21b39 100755 --- a/ci/build-wheels.sh +++ b/ci/build-wheels.sh @@ -17,6 +17,8 @@ done # Bundle external shared libraries into the wheels for whl in /io/wheels/*.whl; do auditwheel repair "$whl" --plat $PLAT -w /io/wheels/ + # Delete the original wheel. They are unusable as they contain no valid platform tag. + rm "$whl" done # Install packages and test diff --git a/ci/download_release_files.py b/ci/download_release_files.py new file mode 100644 index 0000000..12bdbb7 --- /dev/null +++ b/ci/download_release_files.py @@ -0,0 +1,24 @@ +import requests +import os + +HERE = os.path.dirname(__file__) +DIST_DIR = os.path.abspath(os.path.join(HERE, '..', 'dist')) +REPO = 'jrast/littlefs-python' +resp = requests.get('https://api.github.com/repos/%s/releases/latest' % REPO) + +if resp.status_code != 200: + raise RuntimeError('Github API call failed!') + +data = resp.json() + +print('Release Tag:', data['tag_name']) + +print('Assets:') +for e in data['assets']: + print('Downloading', e['name']) + r = requests.get(e['browser_download_url'], allow_redirects=True) + if r.status_code != 200: + raise RuntimeError('Downloading %s failed!' % e['name']) + with open(os.path.join(DIST_DIR, e['name']), 'wb') as fh: + fh.write(r.content) + diff --git a/setup.py b/setup.py index 9cf650a..67247f5 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +from os import path from setuptools import setup, find_packages from setuptools import Extension from Cython.Build import cythonize @@ -16,20 +17,28 @@ ) ] + + setup_requires = [ 'setuptools_scm', ] +HERE = path.abspath(path.dirname(__file__)) +with open(path.join(HERE, 'README.rst'), encoding='utf-8') as fh: + long_description = fh.read() + setup( name='littlefs-python', url='https://github.com/jrast/littlefs-python', author='Jürg Rast', author_email='juergr@gmail.com', + long_description=long_description, + long_description_content_type='text/rst', use_scm_version=True, setup_requires=setup_requires, packages=find_packages('src'), package_dir={'': 'src'}, - ext_modules=cythonize(EXTENSIONS, language_level=3, annotate=False, + ext_modules=cythonize(EXTENSIONS, language_level=3, annotate=False, compiler_directives={'embedsignature': True}), classifiers=[ 'Development Status :: 3 - Alpha',