Skip to content

Commit c904ef7

Browse files
authored
Merge pull request #37 from cmacmackin/modern-packaging
Automate publishing
2 parents 0551017 + 97c5b65 commit c904ef7

File tree

3 files changed

+65
-49
lines changed

3 files changed

+65
-49
lines changed

.github/workflows/publish.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up Python
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: '3.x'
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install build
20+
- name: Build package
21+
run: python -m build --sdist --wheel
22+
- name: Publish package
23+
uses: pypa/gh-action-pypi-publish@v1
24+
with:
25+
user: __token__
26+
password: ${{ secrets.PYPI_DEPLOYMENT_TOKEN }}

pyproject.toml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[build-system]
2+
requires = [
3+
"setuptools >= 61.0.0",
4+
"setuptools_scm[toml] >= 6.2",
5+
]
6+
build-backend = "setuptools.build_meta"
7+
8+
[project]
9+
name = "markdown-include"
10+
description = "A Python-Markdown extension which provides an 'include' function"
11+
readme = "README.md"
12+
requires-python = ">=3.7"
13+
classifiers = [
14+
"Programming Language :: Python",
15+
"Development Status :: 5 - Production/Stable",
16+
"Intended Audience :: Developers",
17+
"Topic :: Internet :: WWW/HTTP :: Site Management",
18+
"Topic :: Software Development :: Documentation",
19+
"Topic :: Software Development :: Libraries :: Python Modules",
20+
"Topic :: Text Processing :: Filters",
21+
"Topic :: Text Processing :: Markup :: HTML",
22+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
23+
]
24+
keywords = ["Markdown", "typesetting", "include", "plugin", "extension"]
25+
license = {text = "GNU General Public License v3 (GPLv3)"}
26+
authors = [{name = "Chris MacMackin", email = "[email protected]"}]
27+
urls = {project = "https://github.com/cmacmackin/markdown-include"}
28+
dependencies = [
29+
"markdown>=3.0",
30+
]
31+
dynamic = ["version"]
32+
33+
[tool.setuptools]
34+
packages = ["markdown_include"]
35+
36+
[tool.setuptools.dynamic]
37+
version = { attr = "setuptools_scm.get_version" }

setup.py

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,2 @@
1-
from setuptools import setup, find_packages
2-
from codecs import open # To use a consistent encoding
3-
from os import path
4-
5-
here = path.abspath(path.dirname(__file__))
6-
7-
# Get the long description from the relevant file
8-
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
9-
long_description = f.read()
10-
11-
setup(
12-
name = 'markdown-include',
13-
packages = find_packages(),
14-
version = '0.7.0',
15-
description = 'This is an extension to Python-Markdown which provides an "include" function, similar to that found in LaTeX (and also the C pre-processor and Fortran). I originally wrote it for my FORD Fortran auto-documentation generator.',
16-
long_description = long_description,
17-
author = 'Chris MacMackin',
18-
author_email = '[email protected]',
19-
url = 'https://github.com/cmacmackin/markdown-include/',
20-
download_url = 'https://github.com/cmacmackin/markdown-include/tarball/v0.7.0',
21-
keywords = ['Markdown', 'typesetting', 'include', 'plugin', 'extension'],
22-
classifiers=[
23-
# How mature is this project? Common values are
24-
# 3 - Alpha
25-
# 4 - Beta
26-
# 5 - Production/Stable
27-
'Development Status :: 5 - Production/Stable',
28-
29-
# Indicate who your project is intended for
30-
'Intended Audience :: Developers',
31-
'Topic :: Internet :: WWW/HTTP :: Site Management',
32-
'Topic :: Software Development :: Documentation',
33-
'Topic :: Software Development :: Libraries :: Python Modules',
34-
'Topic :: Text Processing :: Filters',
35-
'Topic :: Text Processing :: Markup :: HTML',
36-
37-
# Pick your license as you wish (should match "license" above)
38-
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
39-
40-
# Specify the Python versions you support here. In particular, ensure
41-
# that you indicate whether you support Python 2, Python 3 or both.
42-
'Programming Language :: Python :: 2',
43-
'Programming Language :: Python :: 2.7',
44-
'Programming Language :: Python :: 3',
45-
'Programming Language :: Python :: 3.3',
46-
'Programming Language :: Python :: 3.4',
47-
],
48-
install_requires = ['markdown>=3.0']
49-
)
1+
from setuptools import setup
2+
setup()

0 commit comments

Comments
 (0)