Skip to content

Commit

Permalink
Configure publish to PyPi
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalibo committed May 8, 2022
1 parent f3e168c commit b1f5fc5
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.6'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 setup.py sdist bdist_wheel
twine upload dist/*
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
pytest==6.2.5
setuptools==59.6.0
wheel==0.37.1
twine==3.8.0
46 changes: 46 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env python3
import re

from setuptools import setup

with open('readme.md', 'r', encoding='utf-8') as f:
README = f.read()

with open('uaparser/__init__.py', 'r', encoding='utf-8') as f:
VERSION = re.search(r"__version__ = '(.+)'", f.read()) \
.group(1)

setup(
name='ua-parser-py',
version=VERSION,
python_requires='>=3.6',
description='Python library to detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data',
long_description=README,
long_description_content_type='text/markdown',
url='https://github.com/vitalibo/ua-parser-py',
author='Vitaliy Boyarsky',
author_email='boyarsky.vitaliy@live.com',
license='MIT',
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='user-agent parser browser engine os device cpu',
packages=['uaparser'],
data_files=[('', ['license.md', 'readme.md'])],
zip_safe=False,
install_requires=[],
platforms='any'
)

0 comments on commit b1f5fc5

Please sign in to comment.