From 5e34850e80d9fcc68ebe894d05f947bf5aa3abe4 Mon Sep 17 00:00:00 2001 From: Suren Khorenyan Date: Sat, 9 Jan 2021 15:31:33 +0300 Subject: [PATCH 1/4] Add testing and deployment actions --- .github/workflows/publish_to_pypi.yml | 27 +++++++++++++++++++++++++++ .github/workflows/run_tests.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/publish_to_pypi.yml create mode 100644 .github/workflows/run_tests.yml diff --git a/.github/workflows/publish_to_pypi.yml b/.github/workflows/publish_to_pypi.yml new file mode 100644 index 0000000..7558cbf --- /dev/null +++ b/.github/workflows/publish_to_pypi.yml @@ -0,0 +1,27 @@ +name: Publish Python 🐍 distributions 📦 to PyPI + +on: + release: + types: [created] + +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: '3.8' + - 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_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml new file mode 100644 index 0000000..29b3b26 --- /dev/null +++ b/.github/workflows/run_tests.yml @@ -0,0 +1,26 @@ +name: Python tests + +on: [push] + +jobs: + unit-tests: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install the package and dependencies + run: python setup.py install +# - name: Lint with flake8 +# run: | +# pip install flake8 +# # stop the build if there are Python syntax errors or undefined names +# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics +# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide +# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with unittest + run: python -m unittest From 18a5db621966489d232cc060fffcd6e1f0c37d33 Mon Sep 17 00:00:00 2001 From: Suren Khorenyan Date: Sat, 9 Jan 2021 15:32:26 +0300 Subject: [PATCH 2/4] Bump version to 1.0.0 --- flask_bcrypt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_bcrypt.py b/flask_bcrypt.py index 5f9508b..0bc72e9 100644 --- a/flask_bcrypt.py +++ b/flask_bcrypt.py @@ -11,7 +11,7 @@ from __future__ import absolute_import from __future__ import print_function -__version_info__ = ('0', '7', '1') +__version_info__ = ('1', '0', '0') __version__ = '.'.join(__version_info__) __author__ = 'Max Countryman' __license__ = 'BSD' From 75d699bd9a52980cee8a3dd415cf3a92aa2938c2 Mon Sep 17 00:00:00 2001 From: Suren Khorenyan Date: Sat, 9 Jan 2021 15:36:52 +0300 Subject: [PATCH 3/4] Declare newer python versions as supported and remove abandoned versions --- .travis.yml | 5 +++-- setup.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 20b49d3..27ceaa8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,11 @@ language: python python: - - 2.6 - 2.7 - - 3.3 - 3.4 - 3.5 - 3.6 + - 3.7 + - 3.8 + - 3.9 install: pip install flask && pip install nose script: python setup.py test diff --git a/setup.py b/setup.py index 5d3c701..83121df 100644 --- a/setup.py +++ b/setup.py @@ -38,13 +38,14 @@ 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ], From 54c8d4c192d960810264c866ff3f606f76e2bbca Mon Sep 17 00:00:00 2001 From: Suren Khorenyan Date: Tue, 19 Jan 2021 22:37:01 +0300 Subject: [PATCH 4/4] upgrade publish action to be triggered on any tag pushed and to use pypa/gh-action-pypi-publish@v1.4.1 (as flask-seasurf) --- .github/workflows/publish-release.yml | 26 ++++++++++++++++++++++++++ .github/workflows/publish_to_pypi.yml | 27 --------------------------- 2 files changed, 26 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/publish-release.yml delete mode 100644 .github/workflows/publish_to_pypi.yml diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 0000000..3fd7f96 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,26 @@ +name: Publish Release +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.8" + - name: Prepare Env + run: | + python -m pip install --upgrade pip + pip install setuptools wheel + - name: Build + run: python setup.py sdist bdist_wheel + - name: Publish + uses: pypa/gh-action-pypi-publish@v1.4.1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/publish_to_pypi.yml b/.github/workflows/publish_to_pypi.yml deleted file mode 100644 index 7558cbf..0000000 --- a/.github/workflows/publish_to_pypi.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Publish Python 🐍 distributions 📦 to PyPI - -on: - release: - types: [created] - -jobs: - build-n-publish: - name: Build and publish Python 🐍 distributions 📦 to PyPI - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 - with: - python-version: '3.8' - - 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_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/*