Skip to content

Commit 682d388

Browse files
committed
Merge branch 'main' of github.com:HinodeXRT/xrtpy into cleanup
2 parents 76887c1 + a645c04 commit 682d388

File tree

15 files changed

+355
-70
lines changed

15 files changed

+355
-70
lines changed

.github/workflows/stale.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'Close stale issues and PR'
2+
on:
3+
schedule:
4+
- cron: '30 1 * * *'
5+
6+
jobs:
7+
stale:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/stale@v3
11+
with:
12+
repo-token: ${{ secrets.GITHUB_TOKEN }}
13+
stale-pr-message: 'This pull request will be closed in 14 days due to six months of inactivity unless the stale label or comment is removed.'
14+
close-pr-message: 'This pull request was closed because it has had no activity for the past six months.'
15+
days-before-pr-stale: 180
16+
days-before-pr-close: 15
17+
# never close issues
18+
days-before-close: -1

.github/workflows/testing.yml

Lines changed: 114 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,129 @@ name: CI
33
on:
44
push:
55
branches:
6-
- main
6+
- master
7+
- v0.*.x
8+
tags:
9+
- "v*"
710
pull_request:
811

912
jobs:
10-
build:
11-
12-
runs-on: ubuntu-latest
13+
tests:
14+
name: ${{ matrix.name }}
15+
runs-on: ${{ matrix.os }}
1316
strategy:
17+
fail-fast: false
1418
matrix:
15-
python-version: [3.7, 3.8]
19+
include:
20+
21+
- name: Python 3.7 with minimal dependencies
22+
os: ubuntu-latest
23+
python: 3.7
24+
toxenv: py37-minimal
25+
26+
- name: Python 3.7
27+
os: ubuntu-latest
28+
python: 3.7
29+
toxenv: py37
30+
31+
- name: Python 3.7 with Astropy dev
32+
os: ubuntu-latest
33+
python: 3.7
34+
toxenv: py37-astropydev
35+
36+
- name: Python 3.9 with SunPy dev
37+
os: ubuntu-latest
38+
python: 3.9
39+
toxenv: py39-sunpydev
40+
41+
- name: Python 3.8 with code coverage
42+
os: ubuntu-latest
43+
python: 3.8
44+
toxenv: py38-cov
45+
46+
- name: Python 3.8 with Numpy dev
47+
os: ubuntu-latest
48+
python: 3.8
49+
toxenv: py38-numpydev
50+
51+
- name: Python 3.9
52+
os: ubuntu-latest
53+
python: 3.9
54+
toxenv: py39
55+
56+
- name: Python 3.9 (Windows)
57+
os: windows-latest
58+
python: 3.9
59+
toxenv: py39
60+
toxposargs: --durations=50
61+
62+
- name: Python 3.8 (MacOS X)
63+
os: macos-latest
64+
python: 3.8
65+
toxenv: py38
66+
67+
- name: Documentation
68+
os: ubuntu-latest
69+
python: 3.9
70+
toxenv: build_docs
71+
72+
- name: Linters
73+
os: ubuntu-latest
74+
python: 3.9
75+
toxenv: linters
1676

1777
steps:
18-
- uses: actions/checkout@v2
19-
- name: Set up Python ${{ matrix.python-version }}
78+
- name: Checkout code
79+
uses: actions/checkout@v2
80+
with:
81+
fetch-depth: 0
82+
- name: Set up Python
2083
uses: actions/setup-python@v2
2184
with:
22-
python-version: ${{ matrix.python-version }}
23-
- name: Install dependencies
85+
python-version: ${{ matrix.python }}
86+
- name: Install Python dependencies
87+
run: python -m pip install --upgrade tox codecov
88+
- name: Install language-pack-fr and tzdata
89+
if: startsWith(matrix.name, 'Documentation')
90+
run: sudo apt-get install graphviz pandoc
91+
- name: Run tests
92+
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
93+
- name: Upload coverage to codecov
94+
if: ${{ contains(matrix.toxenv,'-cov') }}
95+
uses: codecov/codecov-action@v1
96+
with:
97+
file: ./coverage.xml
98+
build-n-publish:
99+
name: Packaging
100+
runs-on: ubuntu-18.04
101+
needs: tests
102+
steps:
103+
- uses: actions/checkout@master
104+
- name: Get history and tags for SCM versioning to work
24105
run: |
25-
python -m pip install --upgrade pip
26-
pip install flake8 pytest pytest-doctestplus
27-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
28-
- name: Lint with flake8
106+
git fetch --prune --unshallow
107+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
108+
- name: Set up Python 3.7
109+
uses: actions/setup-python@v1
110+
with:
111+
python-version: 3.7
112+
- name: Install requirements
29113
run: |
30-
# stop the build if there are Python syntax errors or undefined names
31-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
32-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
33-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34-
- name: Test with pytest
114+
pip install --upgrade pip
115+
pip install setuptools numpy wheel setuptools_scm twine
116+
- name: Build a binary wheel
117+
run: python setup.py bdist_wheel
118+
- name: Build a source tarball
119+
run: python setup.py sdist
120+
- name: Twine check
121+
run: twine check dist/*
122+
- name: Install PlasmaPy in all variants
35123
run: |
36-
pytest
124+
pip install --progress-bar off .[all,dev]
125+
pip install -e .[all,dev]
126+
python setup.py develop
127+
- name: Publish distribution, if tagged, 📦 to PyPI
128+
if: ${{ startsWith(github.ref, 'refs/tags') && !endsWith(github.ref, 'dev') }}
129+
uses: pypa/gh-action-pypi-publish@master
130+
with:
131+
password: ${{ secrets.pypi_access_token }}

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,8 @@ dmypy.json
135135
# Miscellaneous
136136
version.py
137137
.idea
138-
.vscode
138+
.vscode
139+
140+
#ignore mac files
141+
.DS_store
142+
.DS_Store

licenses/PlasmaPy_license.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# PlasmaPy License
2+
3+
Copyright (c) 2015-2021, PlasmaPy Developers.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
* Neither the name of PlasmaPy nor the names of its contributors may be used
16+
to endorse or promote products derived from this software without specific
17+
prior written permission.
18+
19+
Subject to the terms and conditions of this license, each copyright
20+
holder and contributor hereby grants to those receiving rights under
21+
this license a perpetual, worldwide, non-exclusive, no-charge,
22+
royalty-free, irrevocable (except for failure to satisfy the
23+
conditions of this license) patent license to make, have made, use,
24+
offer to sell, sell, import, and otherwise transfer this software,
25+
where such license applies only to those patent claims, already
26+
acquired or hereafter acquired, licensable by such copyright holder or
27+
contributor that are necessarily infringed by:
28+
29+
(a) their Contribution(s) (the licensed copyrights of copyright
30+
holders and non-copyrightable additions of contributors, in source or
31+
binary form) alone; or
32+
33+
(b) combination of their Contribution(s) with the work of authorship
34+
to which such Contribution(s) was added by such copyright holder or
35+
contributor, if, at the time the Contribution is added, such addition
36+
causes such combination to be necessarily infringed. The patent
37+
license shall not apply to any other combinations which include the
38+
Contribution.
39+
40+
Except as expressly stated above, no rights or licenses from any
41+
copyright holder or contributor is granted under this license, whether
42+
expressly, by implication, estoppel or otherwise.
43+
44+
## Disclaimer
45+
46+
This software is provided by the copyright holders and contributors "as is"
47+
and any express or implied warranties, including, but not limited to, the
48+
implied warranties of merchantability and fitness for a particular purpose are
49+
disclaimed. In no event shall the copyright holder or contributors be liable
50+
for any direct, indirect, incidental, special, exemplary, or consequential
51+
damages (including, but not limited to, procurement of substitute goods or
52+
services; loss of use, data, or profits; or business interruption) however
53+
caused and on any theory of liability, whether in contract, strict liability,
54+
or tort (including negligence or otherwise) arising in any way out of the use
55+
of this software, even if advised of the possibility of such damage.

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ build-backend = 'setuptools.build_meta'
1010
line_length = 88
1111
wrap_length = 80
1212
sections = ["FUTURE", "STDLIB", "FIRSTPARTY", "LOCALFOLDER"]
13-
known_first_party = ["plasmapy", ]
13+
known_first_party = ["xrtpy"]
1414
default_section = "STDLIB"
1515
multi_line_output = 3
1616
use_parentheses = true
1717
include_trailing_comma = true
1818
force_alphabetical_sort_within_sections = true
1919
lines_between_types = 1
20+
21+
[ tool.gilesbot ]
22+
[ tool.gilesbot.pull_requests ]
23+
enabled = true

setup.cfg

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,18 @@ docs =
4747
xrtpy = data/*
4848

4949
[tool:pytest]
50+
minversion = 5.1
5051
testpaths = "xrtpy" "docs"
51-
doctest_plus = enabled
52-
text_file_format = rst
53-
addopts = --doctest-rst
52+
norecursedirs = "build" "docs/_build" "examples" "auto_examples"
53+
doctest_optionflags =
54+
NORMALIZE_WHITESPACE
55+
ELLIPSIS
56+
NUMBER
57+
addopts = --doctest-modules --doctest-continue-on-failure --ignore=docs/conf.py
58+
filterwarnings =
59+
ignore:.*Creating a LegacyVersion.*:DeprecationWarning
60+
looponfailroots =
61+
xrtpy
5462

5563
[coverage:run]
5664
omit =

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
""".lstrip()
1919

2020
setup(
21-
use_scm_version={'write_to': os.path.join('xrtpy', 'version.py'),
22-
'write_to_template': VERSION_TEMPLATE},
23-
21+
use_scm_version={
22+
"write_to": os.path.join("xrtpy", "version.py"),
23+
"write_to_template": VERSION_TEMPLATE,
24+
},
2425
)

tox.ini

Lines changed: 62 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,72 @@
11
[tox]
2-
envlist =
3-
py{37,38}-test
4-
build_docs
5-
codestyle
6-
isolated_build = true
7-
# This is included for testing of the template. You can remove it safely.
8-
skip_missing_interpreters = True
2+
envlist = clean,py37,build_docs
3+
isolated_build = True
94

105
[testenv]
11-
# Pass through the following environemnt variables which may be needed for the CI
12-
passenv = HOME WINDIR LC_ALL LC_CTYPE CC CI TRAVIS
13-
14-
# Run the tests in a temporary directory to make sure that we don't import
15-
# the package from the source tree
16-
changedir = .tmp/{envname}
17-
18-
# tox environments are constructued with so-called 'factors' (or terms)
19-
# separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor:
20-
# will only take effect if that factor is included in the environment name. To
21-
# see a list of example environments that can be run, along with a description,
22-
# run:
23-
#
24-
# tox -l -v
25-
#
6+
whitelist_externals=
7+
/bin/bash
8+
/usr/bin/bash
9+
setenv =
10+
MPLBACKEND = agg
11+
COLUMNS = 180
12+
PYTEST_COMMAND = pytest --pyargs xrtpy --durations=25 {toxinidir}{/}docs --ignore={toxinidir}{/}docs{/}conf.py
13+
extras = tests
14+
deps =
15+
numpydev: git+https://github.com/numpy/numpy
16+
astropydev: git+https://github.com/astropy/astropy
17+
sunpydev: git+https://github.com/sunpy/sunpy
18+
cov: pytest-cov
19+
pytest-github-actions-annotate-failures
20+
commands =
21+
cov: {env:PYTEST_COMMAND} {posargs} --cov=xrtpy --cov-report=xml --cov-config={toxinidir}{/}setup.cfg --cov-append --cov-report xml:coverage.xml
22+
2623
description =
2724
run tests
25+
numpydev: with the git main version of numpy
26+
astropydev: with the git main version of astropy
27+
sunpydev: with the git main version of sunpy
28+
minimal: with minimal versions of dependencies
29+
cov: with code coverage
2830

29-
deps =
30-
# The following indicates which extras_require from setup.cfg will be installed
31-
extras =
32-
test
33-
alldeps: all
34-
35-
commands =
36-
pip freeze
37-
pytest --pyargs xrtpy {toxinidir}/docs --cov xrtpy --cov-config={toxinidir}/setup.cfg {posargs}
31+
[testenv:clean]
32+
deps = coverage
33+
skip_install = true
34+
commands = coverage erase
3835

3936
[testenv:build_docs]
40-
changedir = docs
41-
description = invoke sphinx-build to build the HTML docs
37+
changedir = {toxinidir}
4238
extras = docs
39+
setenv =
40+
HOME = {envtmpdir}
41+
commands = sphinx-build docs docs{/}_build{/}html -W -b html
42+
43+
# This env tests minimal versions of each dependency.
44+
[testenv:py37-minimal]
45+
basepython = python3.7
46+
extras =
47+
deps =
48+
pytest-cov
49+
numpy==1.17.0
50+
astropy==4.2
51+
pytest==6.2.4
52+
sunpy==2.0
53+
pillow
54+
55+
setenv =
56+
PYTEST_COMMAND = pytest --pyargs xrtpy --durations=25 {toxinidir}{/}docs --ignore={toxinidir}{/}docs{/}conf.py
57+
58+
[testenv:linters]
59+
deps =
60+
flake8
61+
pydocstyle
62+
flake8-rst-docstrings
63+
pygments
4364
commands =
44-
pip freeze
45-
sphinx-build -W -b html . _build/html {posargs}
65+
flake8 --bug-report
66+
flake8 {toxinidir}{/}xrtpy --count --show-source --statistics
67+
68+
[testenv:py37-minimal-pypi-import]
69+
basepython = python3.7
70+
extras =
71+
deps =
72+
commands = python -c 'import xrtpy'

0 commit comments

Comments
 (0)