Skip to content

Commit 82ca8e8

Browse files
committed
Add: precommit and clean up all files
1 parent 710cb91 commit 82ca8e8

32 files changed

+540
-509
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
pip install nox
1313
pip list
1414
- run:
15-
name: Build book html
15+
name: Build book html
1616
command: nox -s docs
1717

1818
- store_artifacts:

.github/workflows/build-book.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: build-test-deploy-book
22

33
# Only build PRs, the main branch, and releases. Pushes to branches will only
4-
# be built when a PR is opened. This avoids duplicated buids in PRs comming
4+
# be built when a PR is opened. This avoids duplicated buids in PRs coming
55
# from branches in the origin repository (1 for PR and 1 for push).
66
# This came from Leo's work with fatiando
77
on:
@@ -53,7 +53,7 @@ jobs:
5353
_build/html/
5454
5555
# Push the book's HTML to github-pages
56-
- name: Push to GitHub Pages
56+
- name: Push to GitHub Pages
5757
# Only push if on main branch
5858
if: github.ref == 'refs/heads/main'
5959
uses: peaceiris/[email protected]
@@ -69,5 +69,3 @@ jobs:
6969
arguments: |
7070
--ignore-files "/.+\/_static\/.+/,/genindex.html/"
7171
--ignore-status-codes "404, 403, 503"
72-
73-

.pre-commit-config.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# pre-commit is a tool that you run locally
2+
# to perform a predefined set of tasks manually and/or
3+
# automatically before git commits are made.
4+
# Here we are using pre-commit with the precommit.ci bot to implement
5+
# code fixes automagically in pr's. You will still want to install pre-commit
6+
# to run locally
7+
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
8+
# To run on a pr, add a comment with the text "pre-commit.ci run"
9+
# Common tasks
10+
#
11+
# - Run on all files: pre-commit run --all-files
12+
# - Register git hooks: pre-commit install --install-hooks
13+
14+
ci:
15+
autofix_prs: false
16+
#skip: [flake8, end-of-file-fixer]
17+
autofix_commit_msg: |
18+
'[pre-commit.ci 🤖] Apply code format tools to PR'
19+
# Update hook versions every quarter (so we don't get hit with weekly update pr's)
20+
autoupdate_schedule: quarterly
21+
22+
repos:
23+
24+
# Misc commit checks
25+
- repo: https://github.com/pre-commit/pre-commit-hooks
26+
rev: v4.4.0
27+
# ref: https://github.com/pre-commit/pre-commit-hooks#hooks-available
28+
hooks:
29+
# Autoformat: Makes sure files end in a newline and only a newline.
30+
- id: end-of-file-fixer
31+
# Lint: Check for files with names that would conflict on a
32+
# case-insensitive filesystem like MacOS HFS+ or Windows FAT.
33+
- id: check-case-conflict
34+
- id: trailing-whitespace
35+
36+
- repo: https://github.com/codespell-project/codespell
37+
rev: v2.2.2
38+
hooks:
39+
- id: codespell
40+
additional_dependencies:
41+
- tomli

CONTRIBUTING.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# Contributing Guide for the Python open source software packaging book
1+
# Contributing Guide for the Python open source software packaging book
22

33
This is a community resource. We welcome contributions in the form of issues and/or pull requests to this guide.
44

5-
* If you have an idea for something that should be included in the guide, [please open an issue here](https://github.com/pyOpenSci/python-package-guide/issues).
6-
* If you find a typo, feel free to [submit a pull request](https://github.com/pyOpenSci/python-package-guide/pulls) to modify the text directly. Or, if you are less comfortable with pull requests, feel free to open an issue.
7-
* If you want to see a larger change to the content of the guide book, please submit an issue first!
5+
* If you have an idea for something that should be included in the guide, [please open an issue here](https://github.com/pyOpenSci/python-package-guide/issues).
6+
* If you find a typo, feel free to [submit a pull request](https://github.com/pyOpenSci/python-package-guide/pulls) to modify the text directly. Or, if you are less comfortable with pull requests, feel free to open an issue.
7+
* If you want to see a larger change to the content of the guide book, please submit an issue first!
88

99
## How this guide structured
1010

1111
Most of this repository is structured for **Sphinx**, a documentation engine built in `Python`. We are using the Sphinx Book Theme and the `myST` syntax to create each page in this book.
1212

13-
If you wish to contribute by working on the guide book locally, you
14-
will first need to
13+
If you wish to contribute by working on the guide book locally, you
14+
will first need to
1515

16-
1. Fork this repository
16+
1. Fork this repository
1717
2. Clone it locally
18-
3. Build the documentation locally
18+
3. Build the documentation locally
1919

2020
## Instructions for building the documentation locally on your computer
2121

22-
The easiest way to build the documentation in this repository is to use `nox`,
22+
The easiest way to build the documentation in this repository is to use `nox`,
2323
a tool for quickly building environments and running commands within them.
2424
Nox ensures that your environment has all the dependencies needed to build the documentation.
2525

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ pyOpenSci is devoted to building diverse, supportive community around
1515
the Python open source tools that drive open science. We do this through:
1616

1717
* open peer review
18-
* mentorship and
18+
* mentorship and
1919
* training.
2020

21-
pyOpenSci is an independent organization, fiscally sponsored by Community
22-
Initiatives.
21+
pyOpenSci is an independent organization, fiscally sponsored by Community
22+
Initiatives.
2323

2424
:construction: Construction note :construction:
2525

@@ -97,4 +97,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
9797

9898
<!-- ALL-CONTRIBUTORS-LIST:END -->
9999

100-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
100+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

_static/pyos.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ figcaption {
4141
.admonition p {
4242
font-size: 1.1em;
4343
font-weight: bold;
44-
}
44+
}

_templates/header.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
<!-- <link rel="preconnect" href="https://fonts.googleapis.com">
44
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
55
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=Raleway:wght@200;300;400;600&display=swap" rel="stylesheet"> -->
6-
<!-- END custom head content -->
7-
6+
<!-- END custom head content -->

ci-and-testing/intro.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
This section is evolving and should be published by the end of Spring 2023
55

66

7-
coming soon
7+
coming soon

code-style-structure/intro.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Code style and structure
22

33

4-
Under development
4+
Under development

codespell-ignore.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aways

conf.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@
7474
# directories to ignore when looking for source files.
7575
# This pattern also affects html_static_path and html_extra_path.
7676
exclude_patterns = [
77-
"_build",
78-
"Thumbs.db",
79-
".DS_Store",
80-
".github",
81-
".nox",
77+
"_build",
78+
"Thumbs.db",
79+
".DS_Store",
80+
".github",
81+
".nox",
8282
"README.md"
8383
]
8484

@@ -99,4 +99,4 @@
9999
# Add any paths that contain custom static files (such as style sheets) here,
100100
# relative to this directory. They are copied after the builtin static files,
101101
# so a file named "default.css" will overwrite the builtin "default.css".
102-
html_static_path = ['_static']
102+
html_static_path = ['_static']

documentation/hosting-tools/intro.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Tools to Build and Host your Documentation
1+
# Tools to Build and Host your Documentation
22

3-
The most common tool for building documentation in the Python
4-
ecosystem currently is Sphinx. However, some maintainers
5-
are using tools like [mkdocs](https://www.mkdocs.org/) for documentation. It is
3+
The most common tool for building documentation in the Python
4+
ecosystem currently is Sphinx. However, some maintainers
5+
are using tools like [mkdocs](https://www.mkdocs.org/) for documentation. It is
66
up to you to use the platform that you prefer for your documentation!
77

8-
In this section, we introduce Sphinx as a common tool to
9-
build documentation. We talk about various syntax options that you can use
8+
In this section, we introduce Sphinx as a common tool to
9+
build documentation. We talk about various syntax options that you can use
1010
when writing Sphinx documentation including mySt and rST.
1111

12-
We also talk about ways to publish your
13-
documentation online and Sphinx tools that might help you optimize
14-
your documentation website.
12+
We also talk about ways to publish your
13+
documentation online and Sphinx tools that might help you optimize
14+
your documentation website.
1515

1616
## Documentation build tools outline
1717

Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
# Documentation syntax: markdown vs. myST vs. rst syntax to create your docs
1+
# Documentation syntax: markdown vs. myST vs. rst syntax to create your docs
22

33
There are three commonly used syntaxes for creating Python documentation:
4-
1. [markdown](https://www.markdownguide.org/): Markdown is an easy-to-learn text
5-
syntax. It is the default syntax use in Jupyter Notebooks. There are tools that you can add to a Sphinx website that allow it to render markdown as html. However, using markdown to write documentation has limitations. For instance if you want to add references,
6-
colored call out blocks and other custom elements to your documentation, you will
4+
1. [markdown](https://www.markdownguide.org/): Markdown is an easy-to-learn text
5+
syntax. It is the default syntax use in Jupyter Notebooks. There are tools that you can add to a Sphinx website that allow it to render markdown as html. However, using markdown to write documentation has limitations. For instance if you want to add references,
6+
colored call out blocks and other custom elements to your documentation, you will
77
need to use either **myST** or **rST**.
88
1. [rST (ReStructured Text):](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html). **rST** is the native syntax that sphinx supports. rST was the default syntax used for documentation for many years. However, in recent years myST has risen to the top as a favorite for documentation given the flexibility that it allows.
9-
1. [myST:](https://myst-parser.readthedocs.io/en/latest/intro.html) myST is a combination of vanilla of `markdown` and `rST` syntax. It is a nice option if you are comfortable writing markdown. `myst` is preferred by many because it offers both the rich functionality
10-
of rST combined with a simple-to-write markdown syntax.
9+
1. [myST:](https://myst-parser.readthedocs.io/en/latest/intro.html) myST is a combination of vanilla of `markdown` and `rST` syntax. It is a nice option if you are comfortable writing markdown. `myst` is preferred by many because it offers both the rich functionality
10+
of rST combined with a simple-to-write markdown syntax.
1111

12-
While you can chose to use any of the syntaxes listed above, we suggest using
12+
While you can chose to use any of the syntaxes listed above, we suggest using
1313
`myST` because:
1414

1515
* It is a simpler syntax and thus easier to learn;
16-
* The above simplicity will make it easier for more people to contribute to your documentation.
16+
* The above simplicity will make it easier for more people to contribute to your documentation.
1717
* Most of your corePythonpackage text files, such as your README.md file, are already in `.md` format
18-
* `GitHub` and `Jupyter Notebooks` support markdown thus it's more widely used in the scientific ecosystem.
18+
* `GitHub` and `Jupyter Notebooks` support markdown thus it's more widely used in the scientific ecosystem.
1919

2020

2121
```{tip}
22-
If you are on the fence about myST vs rst, you might find that **myST** is easier
23-
for more people to contribute to.
22+
If you are on the fence about myST vs rst, you might find that **myST** is easier
23+
for more people to contribute to.
2424
```
2525

26-
<!-- TODO
27-
- add some text examples of using rst vs md vs myst?
26+
<!-- TODO
27+
- add some text examples of using rst vs md vs myst?
2828
- Better explain what rst / myst offer that markdown can't do
2929
-->
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
11
# How to publish your Python package documentation online
22

3-
We suggest that you setup a hosting service for your Python package
3+
We suggest that you setup a hosting service for your Python package
44
documentation. Two free and commonly used ways to
5-
quickly create a documentation website hosting environment are below.
5+
quickly create a documentation website hosting environment are below.
66

7-
1. You can host your documentation yourself using [GitHub Pages](https://pages.github.com/) or another online hosting service.
7+
1. You can host your documentation yourself using [GitHub Pages](https://pages.github.com/) or another online hosting service.
88
1. You can host your documentation using [Read the Docs](https://readthedocs.org/).
99

1010
## What is Read the Docs ?
11-
[Read the Docs](https://readthedocs.org/) is a documentation hosting service that supports publishing your project's documentation.
11+
[Read the Docs](https://readthedocs.org/) is a documentation hosting service that supports publishing your project's documentation.
1212

13-
Read the Docs is a fully featured, free, documentation hosting
13+
Read the Docs is a fully featured, free, documentation hosting
1414
service. Some of its many features include:
1515

1616
* Is free to host your documentation (but there are also paid tiers if you wish to customize hosting)
17-
* Automates building your documentation
17+
* Automates building your documentation
1818
* Allows you to turn on integration with pull requests where you can view documentation build progress (success vs failure).
19-
* Supports versioning of your documentation which allows users to refer to older tagged versions of the docs if they are using older versions of your package.
20-
* Supports downloading of documentation in PDF and other formats.
21-
* You can customize the documentation build using a **.readthedocs.yaml** file in your GitHub repository.
19+
* Supports versioning of your documentation which allows users to refer to older tagged versions of the docs if they are using older versions of your package.
20+
* Supports downloading of documentation in PDF and other formats.
21+
* You can customize the documentation build using a **.readthedocs.yaml** file in your GitHub repository.
2222

2323

2424
## What is GitHub Pages?
25-
[GitHub Pages](https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages) is a free web
26-
hosting service offered by GitHub. Using GitHub pages, you can build your
27-
documentation locally or using a Continuous Integration setup, and then push
28-
to a branch in your GitHub repository that is setup to run the GitHub Pages
29-
web build.
25+
[GitHub Pages](https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages) is a free web
26+
hosting service offered by GitHub. Using GitHub pages, you can build your
27+
documentation locally or using a Continuous Integration setup, and then push
28+
to a branch in your GitHub repository that is setup to run the GitHub Pages
29+
web build.
3030

3131

3232

33-
## Read the Docs vs GitHub Pages
33+
## Read the Docs vs GitHub Pages
3434

35-
GitHub pages is a great option for your documentation deployment.
36-
However, you will need to do a bit more work to build and deploy your
37-
documentation if you use GitHub pages.
35+
GitHub pages is a great option for your documentation deployment.
36+
However, you will need to do a bit more work to build and deploy your
37+
documentation if you use GitHub pages.
3838

39-
Read the Docs can be setup in your Read the Docs user account. The service
40-
and automates the entire process of building and deploying your documentation.
39+
Read the Docs can be setup in your Read the Docs user account. The service
40+
and automates the entire process of building and deploying your documentation.
4141

42-
If you don't want to maintain a documentation website for your Python package,
42+
If you don't want to maintain a documentation website for your Python package,
4343
we suggest using the Read the Docs website.
44-

0 commit comments

Comments
 (0)