Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca5ddef

Browse files
committed
MNT: Modernize packaging
and update readme to clarify dev expectation.
1 parent 04d69ba commit ca5ddef

File tree

7 files changed

+82
-14
lines changed

7 files changed

+82
-14
lines changed

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
pull_request:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
build-n-publish:
11+
name: Build and publish Python 🐍 distributions 📦 to PyPI
12+
runs-on: ubuntu-latest
13+
if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || contains(github.event.pull_request.labels.*.name, 'Build wheels'))
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
- uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.8
22+
23+
- name: Install python-build and twine
24+
run: python -m pip install pip build "twine>=3.3" -U
25+
26+
- name: Build package
27+
run: python -m build --sdist --wheel .
28+
29+
- name: List result
30+
run: ls -l dist
31+
32+
- name: Check dist
33+
run: python -m twine check --strict dist/*
34+
35+
- name: Test package
36+
run: |
37+
cd ..
38+
python -m venv testenv
39+
testenv/bin/pip install pytest sphinx_automodapi/dist/*.whl
40+
testenv/bin/pytest sphinx_automodapi
41+
42+
- name: Publish distribution 📦 to PyPI
43+
if: startsWith(github.ref, 'refs/tags')
44+
uses: pypa/gh-action-pypi-publish@release/v1
45+
with:
46+
user: __token__
47+
password: ${{ secrets.pypi_password }}

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ include README.rst
22
include CHANGES.rst
33
include LICENSE.rst
44

5+
include setup.cfg
6+
57
exclude *.pyc *.o
68
prune build

README.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,14 @@ or if you have `tox <https://tox.readthedocs.io/en/latest/>`_ installed::
2626
:target: https://codecov.io/gh/astropy/sphinx-automodapi
2727
.. |PyPI| image:: https://img.shields.io/pypi/v/sphinx-automodapi.svg
2828
:target: https://pypi.python.org/pypi/sphinx-automodapi
29+
30+
Development status
31+
------------------
32+
33+
Due to the limitations of FOSS development model, the Astropy Project
34+
does not have enough bandwidth to add new features or fixes to this
35+
package beyond what is necessary for the project itself. Therefore,
36+
we apologize for any inconvenience caused by unresolved open issues
37+
and unmerged stale pull requests. If you have any questions or concerns,
38+
please contact the project via https://www.astropy.org/help .
39+
Thank you for your interest in this package!

docs/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# -*- coding: utf-8 -*-
33
#
44
# -- General configuration ------------------------------------------------
5+
from sphinx_automodapi import __version__
56

67
# Add any Sphinx extension module names here, as strings. They can be
78
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -27,10 +28,10 @@
2728
# |version| and |release|, also used in various other places throughout the
2829
# built documents.
2930
#
30-
# The short X.Y version.
31-
version = '0.14.dev0'
3231
# The full version, including alpha/beta/rc tags.
33-
release = version
32+
release = __version__
33+
# The short X.Y version.
34+
version = '.'.join(release.split('.')[:2])
3435

3536
# The language for content autogenerated by Sphinx. Refer to documentation
3637
# for a list of supported languages.

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[build-system]
2+
requires = ["setuptools>=30.3.0",
3+
"setuptools_scm",
4+
"wheel"]
5+
build-backend = 'setuptools.build_meta'

setup.cfg

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[metadata]
22
name = sphinx-automodapi
3-
version = attr:sphinx_automodapi.__version__
43
description = Sphinx extension for auto-generating API documentation for entire modules
54
long_description = file:README.rst
5+
long_description_content_type = text/x-rst
66
author = The Astropy Developers
77
author_email = [email protected]
88
license = BSD 3-Clause License
@@ -33,3 +33,13 @@ test =
3333
[options.package_data]
3434
sphinx_automodapi = templates/*/*.rst
3535
sphinx_automodapi.tests = cases/*/*.*, cases/*/*/*.*, cases/*/*/*/*.*, cases/*/*/*/*/*.*
36+
37+
[tool:pytest]
38+
minversion = 4.6
39+
testpaths = sphinx_automodapi
40+
xfail_strict = true
41+
filterwarnings =
42+
error
43+
44+
[flake8]
45+
max-line-length = 100

setup.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
#!/usr/bin/env python
22

3-
import sys
4-
import setuptools
5-
from distutils.version import LooseVersion
3+
import os
64
from setuptools import setup
75

8-
# Setuptools 30.3.0 or later is needed for setup.cfg options to be used
9-
if LooseVersion(setuptools.__version__) < LooseVersion('30.3.0'):
10-
sys.stderr.write("ERROR: sphinx-automodapi requires setuptools 30.3.0 or "
11-
"later (found {0})".format(setuptools.__version__))
12-
sys.exit(1)
13-
14-
setup()
6+
setup(use_scm_version={'write_to': os.path.join('sphinx_automodapi', 'version.py')})

0 commit comments

Comments
 (0)