Skip to content

Commit

Permalink
Use pyproject.toml, update workflow, actions and Python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ei-grad committed Sep 5, 2024
1 parent 4596f3a commit ecebb48
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 58 deletions.
50 changes: 29 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,32 @@ on:

jobs:
build:
name: Build wheel
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install setuptools and wheel
run: pip install setuptools wheel
- name: Run bdist_wheel
run: python setup.py bdist_wheel --universal
- name: Build distribution
run: python -m build .
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheel
path: dist/*.whl
path: dist/
test:
name: Run tests
needs: build
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Download wheel from artifacts
uses: actions/download-artifact@v3
with:
name: wheel
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Install wheel
shell: bash
run: pip install *.whl
Expand All @@ -54,19 +47,34 @@ jobs:
if: runner.os == 'Windows'
shell: bash
run: pytest --collect-only -q | grep ^test_ | while read testname; do pytest -q $testname; done
pypi-publish-test:
name: Release on test.pypi.org
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment:
name: Test PyPI
url: "https://test.pypi.org/project/flask-shell-ipython/"
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
repository-url: "https://test.pypi.org/legacy/"
pypi-publish:
name: Upload release to PyPI
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment: release
environment:
name: PyPI
url: "https://pypi.org/project/flask-shell-ipython/"
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: wheel
path: dist/
uses: actions/download-artifact@v4
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "flask-shell-ipython"
version = "0.5.2"
description = "Replace default `flask shell` command by similar command running IPython."
readme = "README.md"
readme-content-type = "text/markdown"
requires-python = ">=3.6"
license = { file = "LICENSE" }
authors = [
{ name = "Andrew Grigorev", email = "[email protected]" }
]
homepage = "https://github.com/ei-grad/flask-shell-ipython"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Framework :: Flask",
"Framework :: IPython",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
]

dependencies = [
"Flask>=1.0",
"click",
"IPython>=5.0.0"
]

[project.entry-points."flask.commands"]
shell = "flask_shell_ipython:shell"
5 changes: 0 additions & 5 deletions setup.cfg

This file was deleted.

32 changes: 0 additions & 32 deletions setup.py

This file was deleted.

0 comments on commit ecebb48

Please sign in to comment.