From 6e7a5312dcffe693d2809e9d4f701d60de853987 Mon Sep 17 00:00:00 2001 From: Robert Palmer Date: Thu, 21 Oct 2021 22:31:26 -0400 Subject: [PATCH] GitHub actions build --- .github/workflows/python-publish.yml | 26 ++++++++++++++++++++++++++ README.rst | 10 ++-------- pyproject.toml | 5 +++++ setup.py | 5 ++++- ua_parser/__init__.py | 2 +- 5 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/python-publish.yml create mode 100644 pyproject.toml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..cf66dd8 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,26 @@ +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python setup.py sdist + twine upload dist/* diff --git a/README.rst b/README.rst index 08db00c..3a17191 100644 --- a/README.rst +++ b/README.rst @@ -1,15 +1,9 @@ uap-python ========== -A python implementation of the UA Parser (https://github.com/ua-parser, +An **up to date** python implementation of the UA Parser (https://github.com/ua-parser, formerly https://github.com/tobie/ua-parser) -Build Status ------------- - -.. image:: https://travis-ci.org/ua-parser/uap-python.svg - :target: https://travis-ci.org/ua-parser/uap-python - Installing ---------- @@ -20,7 +14,7 @@ Just run: .. code-block:: sh - $ pip install ua-parser + $ pip install ua-parser-up2date Manual install ~~~~~~~~~~~~~~ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6ddb34b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[build-system] +# These are the assumed default build requirements from pip: +# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support +requires = ["setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 091dccd..878ae36 100644 --- a/setup.py +++ b/setup.py @@ -184,7 +184,7 @@ class sdist(_sdist): setup( name="ua-parser-up2date", - version="0.14.0", + version="0.14.1", description="Python port of Browserscope's user agent parser that is kept up to date!", author="PBS", author_email="no-reply@pbs.org", @@ -196,6 +196,7 @@ class sdist(_sdist): include_package_data=True, setup_requires=["pyyaml"], install_requires=[], + python_requires='>=3.8', cmdclass=cmdclass, classifiers=[ "Development Status :: 5 - Production/Stable", @@ -213,4 +214,6 @@ class sdist(_sdist): "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ], + long_description=open('README.rst').read(), + long_description_content_type='text/x-rst' ) diff --git a/ua_parser/__init__.py b/ua_parser/__init__.py index ca04bbe..f16f28f 100644 --- a/ua_parser/__init__.py +++ b/ua_parser/__init__.py @@ -1 +1 @@ -VERSION = (0, 10, 0) +VERSION = (0, 14, 0)