Skip to content

Commit

Permalink
Merge pull request #40 from glue-viz/retemplate
Browse files Browse the repository at this point in the history
Retemplate repo
  • Loading branch information
Nabil Freij authored Sep 19, 2024
2 parents 8a54e63 + 0435fd4 commit b728024
Show file tree
Hide file tree
Showing 36 changed files with 556 additions and 394 deletions.
11 changes: 11 additions & 0 deletions .codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
comment: off
coverage:
status:
project:
default:
threshold: 0.2%

codecov:
require_ci_to_pass: false
notify:
wait_for_ci: true
30 changes: 30 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[run]
omit =
glue_solar/conftest.py
glue_solar/*setup_package*
glue_solar/extern/*
glue_solar/version*
*/glue_solar/conftest.py
*/glue_solar/*setup_package*
*/glue_solar/extern/*
*/glue_solar/version*

[report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about packages we have installed
except ImportError
# Don't complain if tests don't hit assertions
raise AssertionError
raise NotImplementedError
# Don't complain about script hooks
def main(.*):
# Ignore branches that don't pertain to this version of Python
pragma: py{ignore_python_version}
# Don't complain about IPython completion helper
def _ipython_key_completions_
# typing.TYPE_CHECKING is False at runtime
if TYPE_CHECKING:
# Ignore typing overloads
@overload
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://editorconfig.org
root=true
# utf, UNIX-style new line

[*]
charset=utf-8
end_of_line=lf
insert_final_newline=true
trim_trailing_whitespace=true

[*.{py,rst,md}]
indent_style=space
indent_size=4

[*.yml]
indent_style=space
indent_size=2
9 changes: 4 additions & 5 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- linux: codestyle
libraries:
coverage: false
- linux: py39
- linux: py312
test:
needs: [core]
Expand All @@ -51,8 +51,7 @@ jobs:
brew:
- enchant
envs: |
- linux: py310-devdeps
- linux: py39-docs
- linux: py312-docs
coverage: false
- macos: py38
- windows: py39
- macos: py312
- windows: py312
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ pip-wheel-metadata
glue_solar/_version.py
.tmp
.qt_for_python
docs/generated/
14 changes: 14 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[settings]
balanced_wrapping = true
skip =
docs/conf.py
default_section = THIRDPARTY
include_trailing_comma = true
known_astropy = astropy, asdf, sunpy
known_first_party = glue_solar
length_sort = false
length_sort_sections = stdlib
line_length = 110
multi_line_output = 3
no_lines_before = LOCALFOLDER
sections = STDLIB, THIRDPARTY, ASTROPY, FIRSTPARTY, LOCALFOLDER
35 changes: 18 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
exclude: ".*(.csv|.fits|.fts|.fit|.header|.txt|tca.*|.json|.asdf)$|^CITATION.rst"
repos:
- repo: https://github.com/myint/autoflake
rev: v1.4
# This should be before any formatting hooks like isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.6.5"
hooks:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|__init__.py|docs/conf.py)$"
- repo: https://github.com/ambv/black
rev: 22.6.0
hooks:
- id: black
- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
- id: ruff
args: ["--fix"]
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: ['--sp','setup.cfg']
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.6.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: trailing-whitespace
exclude: ".*(.fits|.fts|.fit|.txt)$"
- id: check-yaml
- id: debug-statements
- id: check-added-large-files
args: ["--enforce-all", "--maxkb=1054"]
exclude: ""
- id: end-of-file-fixer
exclude: ".*(.fits|.fts|.fit|.txt|tca.*)$"
- id: mixed-line-ending
exclude: ".*(.fits|.fts|.fit|.txt|tca.*)$"
- repo: https://github.com/crate-ci/typos
rev: v1.22.9
hooks:
- id: typos
ci:
autofix_prs: false
autoupdate_schedule: "quarterly"
21 changes: 15 additions & 6 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
version: 2

build:
os: ubuntu-20.04
os: ubuntu-lts-latest
tools:
python: "3.9"
python: "mambaforge-latest"
apt_packages:
- libxkbcommon-x11-0
- libxcb-icccm4
Expand All @@ -12,16 +13,24 @@ build:
- libxcb-render-util0
- libxcb-xfixes0
- libxcb-xinerama0
jobs:
post_checkout:
- git fetch --unshallow || true
pre_install:
- git update-index --assume-unchanged .rtd-environment.yml docs/conf.py

conda:
environment: .rtd-environment.yml

sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: false

python:
install:
- method: pip
extra_requirements:
install:
- method: pip
extra_requirements:
- all
- docs
path: .
path: .
7 changes: 7 additions & 0 deletions .rtd-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: rtd_glue_solar
channels:
- conda-forge
dependencies:
- python=3.12
- pip
- graphviz!=2.42.*,!=2.43.*
37 changes: 37 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
target-version = "py310"
line-length = 110
exclude = [
".git,",
"__pycache__",
"build",
"*version.py",
]

[lint]
select = ["E", "F", "W", "UP", "PT"]
extend-ignore = [
# pycodestyle (E, W)
"E501", # LineTooLong # TODO! fix
# pytest (PT)
"PT001", # Always use pytest.fixture()
"PT004", # Fixtures which don't return anything should have leading _
"PT007", # Parametrize should be lists of tuples # TODO! fix
"PT011", # Too broad exception assert # TODO! fix
"PT023", # Always use () on pytest decorators
]

[lint.per-file-ignores]
# Part of configuration, not a package.
"setup.py" = ["INP001"]
"conftest.py" = ["INP001"]
"docs/conf.py" = [
"E402" # Module imports not at top of file
]
"docs/*.py" = [
"INP001", # Implicit-namespace-package. The examples are not a package.
]
"__init__.py" = ["E402", "F401", "F403"]
"test_*.py" = ["B011", "D", "E402", "PGH001", "S101"]

[lint.pydocstyle]
convention = "numpy"
2 changes: 1 addition & 1 deletion LICENSE.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2019-2022, Glue developers
Copyright (c) 2019-2024, SunPy and Glue developers

All rights reserved.

Expand Down
3 changes: 3 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
default.extend-ignore-identifiers-re = [
"NDCube",
]
5 changes: 1 addition & 4 deletions docs/api_reference.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _api_reference:
.. _glue_solar_api_reference:

=============
API Reference
Expand All @@ -12,6 +12,3 @@ API Reference

.. automodapi:: glue_solar.sources.maps
:no-inheritance-diagram:

.. automodapi:: glue_solar.pixel_extraction
:no-inheritance-diagram:
Loading

0 comments on commit b728024

Please sign in to comment.