From e6ef6d1069309b2783357941ea6f35b1c633ba96 Mon Sep 17 00:00:00 2001 From: Artyom Vancyan Date: Thu, 1 Dec 2022 19:29:33 +0400 Subject: [PATCH 1/3] Add dependencies with minimal versions required --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b6aaab3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +fuzzywuzzy>=0.3.0 +python-Levenshtein>=0.12.1 \ No newline at end of file From 733e5a0229bb9a04c5dac446280eff037e096638 Mon Sep 17 00:00:00 2001 From: Artyom Vancyan Date: Thu, 1 Dec 2022 19:31:13 +0400 Subject: [PATCH 2/3] Setup the package ready to publish --- setup.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6b2bdb3 --- /dev/null +++ b/setup.py @@ -0,0 +1,46 @@ +# Copyright (C) 2022 Artyom Vancyan +# See full copyright notice at __init__.py +import subprocess + +import setuptools + +version = ( + subprocess.run(["git", "describe", "--tags"], stdout=subprocess.PIPE) + .stdout.decode("utf-8") + .strip() +) + +assert "-" not in version +assert "." in version + +# with open("README.md", "r", encoding="utf-8") as fp: +# long_description = fp.read() + +setuptools.setup( + name="fuzzymap", + version=version, + author="Artyom Vancyan", + author_email="artyom@pysnippet.org", + description="", + # long_description=long_description, + # long_description_content_type="text/markdown", + url="https://github.com/pysnippet/fuzzymap", + packages=setuptools.find_packages(), + classifiers=[ + "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", + "Operating System :: OS Independent", + '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 :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Topic :: Software Development :: Libraries :: Python Modules', + ], + python_requires=">=3.6", + install_requires=[ + "fuzzywuzzy>=0.3.0", + "python-Levenshtein>=0.12.1", + ], +) From af1b9e5888c82ad1a731a82f72bac4345a6eead0 Mon Sep 17 00:00:00 2001 From: Artyom Vancyan Date: Thu, 1 Dec 2022 19:32:03 +0400 Subject: [PATCH 3/3] Configure publish workflow using GitHub actions --- .github/workflows/publish.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..435632c --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish to PyPI + +on: + release: + types: [ published ] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + 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: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/*