Skip to content

Commit 55130da

Browse files
committed
DOC: Get docs somewhat in shape.
1 parent 1ab033a commit 55130da

File tree

7 files changed

+45
-24
lines changed

7 files changed

+45
-24
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ Changelog
55
Version 0.1
66
===========
77

8-
- Feature A added
9-
- FIX: nasty bug #1729 fixed
10-
- add your changes here!
8+
- Pulled the ``check_python_h_first.py`` script from SciPy into its
9+
own package

CONTRIBUTING.rst

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
Contributing
2828
============
2929

30-
Welcome to ``check-python-h-first`` contributor's guide.
30+
Welcome to the ``check-python-h-first`` contributor's guide.
3131

3232
This document focuses on getting any potential contributor familiarized
3333
with the development processes, but `other kinds of contributions`_ are also
@@ -106,11 +106,16 @@ and use Python's built-in web server for a preview in your web browser
106106
Code Contributions
107107
==================
108108

109-
.. todo:: Please include a reference or explanation about the internals of the project.
110-
111-
An architecture description, design principles or at least a summary of the
112-
main concepts will make it easy for potential contributors to get started
113-
quickly.
109+
- ``src/check_python_h_first/single_file.py`` contains the checks for
110+
a single file
111+
- ``src/check_python_h_first/wrapper.py`` contains functions to sort a
112+
list of files, send the result to the functions in
113+
``single_file.py``, and aggregate the results.
114+
- ``src/check_python_h_first/get_submodule_paths.py`` contains checks
115+
for files managed by different repositories.
116+
- ``src/check_python_h_first/__main__.py`` provides a command-line
117+
interface.
118+
- The docs are under ``docs``
114119

115120
Submit an issue
116121
---------------
@@ -151,7 +156,6 @@ Clone the repository
151156

152157
to be able to import the package under development in the Python REPL.
153158

154-
.. todo:: if you are not using pre-commit, please remove the following item:
155159

156160
#. Install |pre-commit|_::
157161

@@ -182,8 +186,6 @@ Implement your changes
182186

183187
to record your changes in git_.
184188

185-
.. todo:: if you are not using pre-commit, please remove the following item:
186-
187189
Please make sure to see the validation messages from |pre-commit|_ and fix
188190
any eventual issues.
189191
This should automatically use flake8_/black_ to check/fix the code style
@@ -218,11 +220,10 @@ Submit your contribution
218220
#. Go to the web page of your fork and click |contribute button|
219221
to send your changes for review.
220222

221-
.. todo:: if you are using GitHub, you can uncomment the following paragraph
222-
223-
Find more detailed information in `creating a PR`_. You might also want to open
224-
the PR as a draft first and mark it as ready for review after the feedbacks
225-
from the continuous integration (CI) system or any required fixes.
223+
Find more detailed information in `creating a PR`_. You might also
224+
want to open the PR as a draft first and mark it as ready for
225+
review after the feedbacks from the continuous integration (CI)
226+
system or any required fixes.
226227

227228

228229
Troubleshooting
@@ -302,7 +303,7 @@ on PyPI_, the following steps can be used to release a new version for
302303

303304

304305

305-
.. [#contrib1] Even though, these resources focus on open source projects and
306+
.. [#contrib1] Even though these resources focus on open source projects and
306307
communities, the general ideas behind collaborating with other developers
307308
to collectively create software are general and can be applied to all sorts
308309
of environments, including private companies and proprietary code bases.
@@ -314,8 +315,8 @@ on PyPI_, the following steps can be used to release a new version for
314315
.. |the repository service| replace:: GitHub
315316
.. |contribute button| replace:: "Create pull request"
316317

317-
.. _repository: https://github.com/<USERNAME>/check-python-h-first
318-
.. _issue tracker: https://github.com/<USERNAME>/check-python-h-first/issues
318+
.. _repository: https://github.com/DWesl/check-python-h-first
319+
.. _issue tracker: https://github.com/DWesl/check-python-h-first/issues
319320
.. <-- end -->
320321
321322

README.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ check-python-h-first
1212
====================
1313

1414

15-
Script to check whether Python.h is included first in any headers or
15+
Package to check whether Python.h is included first in any headers or
1616
source files.
17+
Python advises extension modules include ``Python.h`` `before other
18+
files
19+
<https://docs.python.org/3/extending/extending.html#a-simple-example>`_.
20+
This package checks that source files conform to that suggestion.
1721

18-
This file does not handle mazes of ``#ifdef``s: it checks each file
22+
This file does not handle mazes of ``#ifdef``: it checks each file
1923
for ``#include``, whether the file included is ``Python.h``, and, if
2024
so, whether that's the first ``#include`` in that file.
2125

docs/index.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22
check-python-h-first
33
====================
44

5-
This is the documentation of **check-python-h-first**.
5+
Python advises extension modules include ``Python.h`` `before other
6+
files
7+
<https://docs.python.org/3/extending/extending.html#a-simple-example>`_.
8+
This package checks that source files conform to that suggestion.
69

7-
.. note::
10+
The intended use is ``check_python_h_first path/to/header.h
11+
path/to/source.c``: the script will tell you if the files on the
12+
command line include other headers before ``Python.h``. It will also
13+
allow certain headers from Pybind or NumPy as the first included
14+
header.
15+
16+
.. comment
817
918
This is the main page of your project's `Sphinx`_ documentation.
1019
It is formatted in `reStructuredText`_. Add additional pages

src/check_python_h_first/get_submodule_paths.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""Find files in submodules.
22
33
Those should be fixed in upstream project repos, not here.
4+
5+
Originally implemented `in SciPy
6+
<https://github.com/scipy/scipy/blob/888ca356e/tools/get_submodule_paths.py>`_
47
"""
58

69
import glob

src/check_python_h_first/single_file.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""Check that Python.h is included before any stdlib headers.
22
33
May be a bit overzealous, but it should get the job done.
4+
5+
Originally implemented `in SciPy
6+
<https://github.com/scipy/scipy/blob/888ca356/tools/check_python_h_first.py>`_
47
"""
58

69
import os.path

src/check_python_h_first/wrapper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
:func:`.single_file.check_python_h_included_first` on each file,
66
collating the results.
77
8+
Originally implemented `in SciPy
9+
<https://github.com/scipy/scipy/blob/888ca356/tools/check_python_h_first.py>`_
810
"""
911

1012
import fnmatch

0 commit comments

Comments
 (0)