Skip to content

Commit 0beafa6

Browse files
authored
Merge pull request #60 from astronomy-commons/delucchi/copier
Updating to template v1.3.0
2 parents 2ea0e91 + 32e85b5 commit 0beafa6

File tree

18 files changed

+1364
-54
lines changed

18 files changed

+1364
-54
lines changed

.copier-answers.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# Changes here will be overwritten by Copier
2-
_commit: v1.2.1
2+
_commit: v1.3.0
33
_src_path: gh:lincc-frameworks/python-project-template
44
author_email: lincc-frameworks-team@lists.lsst.org
55
author_name: LINCC Frameworks
66
create_example_module: false
7+
custom_install: true
8+
include_notebooks: false
79
module_name: hipscat
10+
mypy_type_checking: basic
811
preferred_linter: pylint
12+
project_license: BSD
913
project_name: hipscat
14+
use_gitlfs: none
1015
use_isort: true

.github/workflows/linting.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ jobs:
2828
- name: Analyze code with linter
2929

3030
run: |
31-
pylint -rn -sn --recursive=y ./src
31+
pylint -rn -sn --recursive=y ./src --rcfile=./src/.pylintrc
3232

.github/workflows/publish-to-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v3
2525
- name: Set up Python
26-
uses: actions/setup-python@v3
26+
uses: actions/setup-python@v4
2727
with:
2828
python-version: '3.x'
2929
- name: Install dependencies

.github/workflows/testing-and-coverage.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ jobs:
3434
run: |
3535
python -m pytest tests --cov=hipscat --cov-report=xml
3636
- name: Upload coverage report to codecov
37-
uses: codecov/codecov-action@v3
37+
uses: codecov/codecov-action@v3
38+
- name: Build docs
39+
run: |
40+
sphinx-build -T -E -b html -d docs/build/doctrees ./docs docs/build/html

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,7 @@ dmypy.json
134134
.vscode/
135135

136136
# dask
137-
dask-worker-space/
137+
dask-worker-space/
138+
139+
# tmp directory
140+
tmp/

.pre-commit-config.yaml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
- id: pytest-check
2222
name: pytest-check
2323
description: Run unit tests with pytest.
24-
entry: python -m pytest --cov=./src --cov-report=html
24+
entry: bash -c "if python -m pytest --co -qq; then python -m pytest --cov=./src --cov-report=html; fi"
2525
language: system
2626
pass_filenames: false
2727
always_run: true
@@ -33,6 +33,10 @@ repos:
3333
- id: no-commit-to-branch
3434
name: Don't commit to main or master branch
3535
description: Prevent the user from committing directly to the primary branch.
36+
- id: check-added-large-files
37+
name: Check for large files
38+
description: Prevent the user from committing very large files.
39+
args: ['--maxkb=500']
3640

3741
# verify that pyproject.toml is well formed
3842
- repo: https://github.com/abravalheri/validate-pyproject
@@ -53,21 +57,55 @@ repos:
5357
files: ^(src|tests)/
5458

5559

56-
# Analyze the code style and report code that doesn't adhere.
60+
# Analyze the src code style and report code that doesn't adhere.
5761
- repo: local
5862
hooks:
5963
- id: pylint
60-
name: pylint (python files in src/ and tests/)
64+
name: pylint (python files in src/)
6165
entry: pylint
6266
language: system
6367
types: [python]
64-
files: ^(src|tests)/
68+
files: ^src/
69+
args:
70+
[
71+
"-rn", # Only display messages
72+
"-sn", # Don't display the score
73+
"--rcfile=src/.pylintrc",
74+
]
75+
# Analyze the tests code style and report code that doesn't adhere.
76+
- repo: local
77+
hooks:
78+
- id: pylint
79+
name: pylint (python files in tests/)
80+
entry: pylint
81+
language: system
82+
types: [python]
83+
files: ^tests/
6584
args:
6685
[
6786
"-rn", # Only display messages
6887
"-sn", # Don't display the score
88+
"--rcfile=tests/.pylintrc",
89+
]
90+
91+
92+
# Analyze type hints and report errors.
93+
- repo: local
94+
hooks:
95+
- id: mypy
96+
name: mypy (python files in src/ and tests/)
97+
entry: mypy
98+
language: system
99+
types: [python]
100+
files: ^(src|tests)/
101+
args:
102+
[
103+
104+
"--ignore-missing-imports", # Ignore imports without type hints
105+
69106
]
70107

108+
# Make sure Sphinx can build the documentation without issues.
71109
- repo: local
72110
hooks:
73111
- id: sphinx-build

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# .readthedocs.yaml
1+
# .readthedocs.yml
22
# Read the Docs configuration file
33
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
44

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2525
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2626
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2727
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

docs/Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
1-
# Minimal makefile for Sphinx documentation
1+
# Makefile for Sphinx documentation
22
#
33

44
# You can set these variables from the command line, and also
55
# from the environment for the first two.
66
SPHINXOPTS ?= -T -E -d _build/doctrees -D language=en
7+
EXCLUDENB ?= -D exclude_patterns="notebooks/*"
78
SPHINXBUILD ?= sphinx-build
89
SOURCEDIR = .
910
BUILDDIR = ../_readthedocs/
1011

12+
.PHONY: help no-nb no-notebooks clean Makefile
13+
1114
# Put it first so that "make" without argument is like "make help".
1215
help:
1316
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1417

15-
.PHONY: help Makefile
18+
# Build all Sphinx docs locally, except the notebooks
19+
no-nb no-notebooks:
20+
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(EXCLUDENB) $(O)
21+
22+
# Cleans up files generated by the build process
23+
clean:
24+
rm -r "_build/doctrees"
25+
rm -r "$(BUILDDIR)"
1626

1727
# Catch-all target: route all unknown targets to Sphinx using the new
1828
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1929
%: Makefile
2030
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21-
31+

docs/conf.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,18 @@
3131
extensions.append("autoapi.extension")
3232

3333
templates_path = []
34-
exclude_patterns = []
34+
exclude_patterns = ["_build", "**.ipynb_checkpoints"]
3535

36-
master_doc = "index" # This assumes that sphinx-build is called from the root directory
37-
html_show_sourcelink = (
38-
False # Remove 'view source code' from top of page (for html, not python)
39-
)
40-
add_module_names = False # Remove namespaces from class/method signatures
36+
# This assumes that sphinx-build is called from the root directory
37+
master_doc = "index"
38+
# Remove 'view source code' from top of page (for html, not python)
39+
html_show_sourcelink = False
40+
# Remove namespaces from class/method signatures
41+
add_module_names = False
4142

4243
autoapi_type = "python"
4344
autoapi_dirs = ["../src"]
4445
autoapi_add_toc_tree_entry = False
4546
autoapi_member_order = "bysource"
4647

47-
# -- Options for HTML output -------------------------------------------------
48-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
49-
5048
html_theme = "sphinx_rtd_theme"
51-
html_sidebars = {
52-
"**": ["globaltoc.html", "relations.html", "searchbox.html"],
53-
}
54-
html_css_files = ["readthedocs-custom.css"] # Override some CSS settings

0 commit comments

Comments
 (0)