Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and deploy #26

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

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
python -m pip install build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
16 changes: 9 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
run: |
python -m pip install --upgrade black flake8
- name: black format check
run: black --check --line-length 120 pandoc_plantuml_filter.py tests setup.py
run: python -m black --check --line-length 120 pandoc_plantuml_filter.py tests
- name: flake8 format check
run: flake8 --max-line-length 120 pandoc_plantuml_filter.py tests setup.py
run: python -m flake8 --max-line-length 120 pandoc_plantuml_filter.py tests
test:
strategy:
fail-fast: false
Expand All @@ -32,13 +32,15 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Setup build and test environment
run: python -m pip install --upgrade pip setuptools wheel pytest pytest-mock
- name: Setup package
run: python -m pip install .
run: python -m pip install --upgrade pip build pytest pytest-mock
- name: Build package
run: python -m build
- name: Install package
run: python -m pip install --pre dist/pandoc_plantuml_filter-*.whl
- name: run unit tests
run: pytest tests/test_unit.py
run: python -m pytest tests/test_unit.py
- name: install dependencies for integration tests
run: sudo apt update && sudo apt install -y pandoc plantuml
- name: run integration tests
run: pytest tests/test_integration.py
run: python -m pytest tests/test_integration.py

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ missfont.log
pandoc_plantuml_filter.egg-info/
plantuml-images/
sample.pdf
dist/
39 changes: 39 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
name = "pandoc-plantuml-filter"
authors = [
{name = "Timo Furrer", email = "[email protected]"},
]
description = "Pandoc filter for PlantUML code blocks"
readme = "README.md"
requires-python = ">=3.8"
keywords = ["plantuml", "pandoc-filter", "pandoc"]
license = {text = "MIT"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"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",
"Programming Language :: Python :: Implementation",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"pandocfilters",
]
dynamic = ["version"]

[project.scripts]
pandoc-plantuml = "pandoc_plantuml_filter:main"

[tool.setuptools_scm]
85 changes: 0 additions & 85 deletions setup.py

This file was deleted.