Skip to content

Commit

Permalink
Add PyPI packaging (#8)
Browse files Browse the repository at this point in the history
* Update package info for PyPI

* Add CI flows for packaging

* Update tox settings for pyproject.toml

* Don't upload to Test PyPI
  • Loading branch information
alexreinking authored Feb 14, 2022
1 parent e0bf0ca commit 7bbfa40
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 10 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,15 @@ jobs:
- run: pylint src/**/*.py test/*.py *.py
env:
PYTHONPATH: ${{ github.workspace }}/src
test-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install Python dependencies
run: |
python -m pip install -U pip
python -m pip install setuptools wheel twine build
- name: Build Python package
run: python -m build --sdist --wheel --outdir dist/ .
23 changes: 23 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Upload Python Package
on:
release:
types: [ created ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install Python dependencies
run: |
python -m pip install -U pip
python -m pip install setuptools wheel twine build
- name: Build Python package
run: python -m build --sdist --wheel --outdir dist/ .

- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
9 changes: 6 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ description = Compiler IR tools
long_description = file: README.md
long_description_content_type = text/markdown
home_page = https://github.com/ChezJrk/asdl
author = VCLS (Visual Computing Languages & Systems)
;author = VCLS (Visual Computing Languages & Systems)
;author_email = TBD
maintainer = Alex Reinking
maintainer_email = [email protected]
license = MIT License
keywords = adt, asdl, development, compilers, ir
python_required =
>=3.5, <4
>=3.8, <4
classifiers =
Development Status :: 3 - Alpha
License :: OSI Approved :: MIT License
Intended Audience :: Developers',
Intended Audience :: Developers
Operating System :: OS Independent
Topic :: Software Development :: Build Tools
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Expand Down Expand Up @@ -51,6 +53,7 @@ known-third-party = asdl

[tox:tox]
envlist = py38, py39, py310
isolated_build = True

[gh-actions]
python =
Expand Down
7 changes: 0 additions & 7 deletions setup.py

This file was deleted.

0 comments on commit 7bbfa40

Please sign in to comment.