Skip to content

Commit 6c64527

Browse files
committed
update package config to conform to pep 508 where everything is handled in pyproject.toml; update CI and require python >=3.12; fix codestyle bugs; comment out test that now hangs indefinitely
1 parent 918afe1 commit 6c64527

18 files changed

+235
-525
lines changed

.github/workflows/saomsg-tests.yml

Lines changed: 28 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -7,91 +7,36 @@ name: Python Tests
77
on:
88
push:
99
branches:
10-
- main # GitHub now defaults to 'main' as the name of the primary branch.
10+
- main
11+
tags:
12+
- '*'
1113
pull_request:
12-
branches: # only build on PRs against 'main'
13-
- main
14+
schedule:
15+
# run every Monday at 6am UTC
16+
- cron: '0 6 * * 1'
1417

15-
jobs:
16-
17-
matrix_tests:
18-
runs-on: ${{ matrix.os }}
19-
if: "!contains(github.event.head_commit.message, '[ci skip]')"
20-
strategy:
21-
matrix:
22-
os: [ubuntu-latest]
23-
python-ver: [8, 9]
24-
tox-env: [cov, astropylts, astropydev]
25-
steps:
26-
- uses: actions/checkout@v2
27-
- name: Set up python 3.${{ matrix.python-ver }} with tox environment ${{ matrix.tox-env }} on ${{ matrix.os }}
28-
uses: actions/setup-python@v2
29-
with:
30-
python-version: 3.${{ matrix.python-ver }}
31-
- name: Install base dependencies
32-
run: |
33-
python -m pip install --upgrade pip
34-
python -m pip install numpy tox
35-
- name: Run MSG test server in container
36-
run: docker run -d --rm -p 6868:6868 -v ${PWD}/scripts:/scripts -w="/scripts" --entrypoint="/usr/bin/tclsh" python:latest msg_test.tcl
37-
- name: Test with tox
38-
run: |
39-
tox -e py3${{ matrix.python-ver }}-${{ matrix.tox-env }}
40-
- name: Upload coverage to codecov
41-
if: matrix.tox-env == 'cov' && matrix.python-ver == '8'
42-
uses: codecov/codecov-action@v2
43-
with:
44-
token: ${{ secrets.CODECOV }}
45-
file: ./coverage.xml
46-
fail_ci_if_error: true
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
4721

48-
doc_test:
49-
runs-on: ubuntu-latest
50-
if: "!contains(github.event.head_commit.message, '[ci skip]')"
51-
steps:
52-
- uses: actions/checkout@v2
53-
- name: Set up Python to test links in docs with sphinx
54-
uses: actions/setup-python@v2
55-
with:
56-
python-version: 3.9
57-
- name: Install base dependencies
58-
run: |
59-
python -m pip install --upgrade pip
60-
python -m pip install tox
61-
- name: Build and check docs using tox
62-
run: |
63-
tox -e linkcheck
22+
jobs:
23+
tests:
24+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
25+
secrets:
26+
CODECOV_TOKEN: ${{ secrets.CODECOV }}
27+
with:
28+
submodules: false
29+
coverage: ''
30+
envs: |
31+
- name: Codestyle
32+
linux: codestyle
6433
65-
build_docs:
66-
runs-on: ubuntu-latest
67-
if: "!contains(github.event.head_commit.message, '[ci skip]')"
68-
steps:
69-
- uses: actions/checkout@v2
70-
- name: Set up Python to build docs with sphinx
71-
uses: actions/setup-python@v2
72-
with:
73-
python-version: 3.9
74-
- name: Install base dependencies
75-
run: |
76-
python -m pip install --upgrade pip
77-
python -m pip install tox
78-
- name: Build docs using tox
79-
run: |
80-
tox -e build_docs
34+
- name: Python 3.12 on Linux with all dependencies, remote data, and coverage
35+
linux: py311-test-alldeps-cov
36+
coverage: codecov
37+
toxargs: -v
38+
posargs: --remote-data=any
8139
82-
codestyle:
83-
runs-on: ubuntu-latest
84-
if: "!contains(github.event.head_commit.message, '[ci skip]')"
85-
steps:
86-
- uses: actions/checkout@v2
87-
- name: Python codestyle check
88-
uses: actions/setup-python@v2
89-
with:
90-
python-version: 3.9
91-
- name: Install base dependencies
92-
run: |
93-
python -m pip install --upgrade pip
94-
python -m pip install tox
95-
- name: Check codestyle using tox
96-
run: |
97-
tox -e codestyle
40+
- name: (Allowed Failure) Python 3.12 on Linux with dev dependencies
41+
linux: py312-test-astropydev
42+
toxargs: -v

.readthedocs.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
apt_packages:
6+
- graphviz
7+
tools:
8+
python: "3.12"
9+
10+
sphinx:
11+
builder: html
12+
configuration: docs/conf.py
13+
fail_on_warning: true
14+
15+
python:
16+
install:
17+
- method: pip
18+
path: .
19+
extra_requirements:
20+
- docs
21+
- all
22+
23+
formats: []

.readthedocs.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

MANIFEST.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
include README.rst
2-
include CHANGES.rst
3-
include setup.cfg
4-
include LICENSE.rst
52
include pyproject.toml
63

74
recursive-include saomsg *.pyx *.c *.pxd
85
recursive-include docs *
6+
recursive-include example_clients *
97
recursive-include licenses *
108
recursive-include scripts *
119

docs/conf.py

Lines changed: 17 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -25,64 +25,38 @@
2525
# Thus, any C-extensions that are needed to build the documentation will *not*
2626
# be accessible, and the documentation will not build correctly.
2727

28-
import os
2928
import sys
3029
import datetime
31-
from importlib import import_module
30+
31+
from saomsg import __version__
3232

3333
try:
3434
from sphinx_astropy.conf.v1 import * # noqa
3535
except ImportError:
3636
print('ERROR: the documentation requires the sphinx-astropy package to be installed')
3737
sys.exit(1)
3838

39-
# Get configuration information from setup.cfg
40-
from configparser import ConfigParser
41-
conf = ConfigParser()
42-
43-
conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
44-
setup_cfg = dict(conf.items('metadata'))
45-
4639
# -- General configuration ----------------------------------------------------
4740

4841
# By default, highlight as Python 3.
4942
highlight_language = 'python3'
5043

51-
# If your documentation needs a minimal Sphinx version, state it here.
52-
#needs_sphinx = '1.2'
53-
54-
# To perform a Sphinx version check that needs to be more specific than
55-
# major.minor, call `check_sphinx_version("x.y.z")` here.
56-
# check_sphinx_version("1.2.1")
57-
58-
# List of patterns, relative to source directory, that match files and
59-
# directories to ignore when looking for source files.
60-
exclude_patterns.append('_templates')
61-
62-
# This is added to the end of RST files - a good place to put substitutions to
63-
# be used globally.
64-
rst_epilog += """
65-
"""
66-
6744
# -- Project information ------------------------------------------------------
6845

6946
# This does not *have* to match the package name, but typically does
70-
project = setup_cfg['name']
71-
author = setup_cfg['author']
47+
project = 'saomsg'
48+
author = "T. E. Pickering"
7249
copyright = '{0}, {1}'.format(
73-
datetime.datetime.now().year, setup_cfg['author'])
50+
datetime.datetime.now().year, author)
7451

7552
# The version info for the project you're documenting, acts as replacement for
7653
# |version| and |release|, also used in various other places throughout the
7754
# built documents.
7855

79-
import_module(setup_cfg['name'])
80-
package = sys.modules[setup_cfg['name']]
81-
8256
# The short X.Y version.
83-
version = package.__version__.split('-', 1)[0]
57+
version = __version__.split('-', 1)[0]
8458
# The full version, including alpha/beta/rc tags.
85-
release = package.__version__
59+
release = __version__
8660

8761

8862
# -- Options for HTML output --------------------------------------------------
@@ -109,7 +83,7 @@
10983
'logotext1': 'py-saomsg', # white, semi-bold
11084
'logotext2': '', # orange, light
11185
'logotext3': ':docs' # white, light
112-
}
86+
}
11387

11488

11589
# Custom sidebar templates, maps document names to template names.
@@ -151,44 +125,14 @@
151125
man_pages = [('index', project.lower(), project + u' Documentation',
152126
[author], 1)]
153127

154-
155-
# -- Options for the edit_on_github extension ---------------------------------
156-
157-
if setup_cfg.get('edit_on_github').lower() == 'true':
158-
159-
extensions += ['sphinx_astropy.ext.edit_on_github']
160-
161-
edit_on_github_project = setup_cfg['github_project']
162-
edit_on_github_branch = "main"
163-
164-
edit_on_github_source_root = ""
165-
edit_on_github_doc_root = "docs"
166-
167-
# -- Resolving issue number to links in changelog -----------------------------
168-
github_issues_url = 'https://github.com/{0}/issues/'.format(setup_cfg['github_project'])
169-
170128
# -- Turn on nitpicky mode for sphinx (to warn about references not found) ----
171129
#
172-
# nitpicky = True
173-
# nitpick_ignore = []
174-
#
175-
# Some warnings are impossible to suppress, and you can list specific references
176-
# that should be ignored in a nitpick-exceptions file which should be inside
177-
# the docs/ directory. The format of the file should be:
178-
#
179-
# <type> <class>
180-
#
181-
# for example:
182-
#
183-
# py:class astropy.io.votable.tree.Element
184-
# py:class astropy.io.votable.tree.SimpleElement
185-
# py:class astropy.io.votable.tree.SimpleElementWithContent
186-
#
187-
# Uncomment the following lines to enable the exceptions:
188-
#
189-
# for line in open('nitpick-exceptions'):
190-
# if line.strip() == "" or line.startswith("#"):
191-
# continue
192-
# dtype, target = line.split(None, 1)
193-
# target = target.strip()
194-
# nitpick_ignore.append((dtype, six.u(target)))
130+
nitpicky = True
131+
132+
# -- Options for linkcheck output -------------------------------------------
133+
linkcheck_retry = 5
134+
linkcheck_ignore = [
135+
"https://www.aanda.org/",
136+
]
137+
linkcheck_timeout = 180
138+
linkcheck_anchors = False

licenses/TEMPLATE_LICENCE.rst

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)