Skip to content

Commit 3774cf9

Browse files
committed
docs(architecture): remove duplicated policy
1 parent 109db81 commit 3774cf9

5 files changed

Lines changed: 33 additions & 184 deletions

File tree

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ however writing code is not the only way to contribute.
2222
- [Style](#style)
2323
- [Docstrings](#docstrings)
2424
- [Quotes](#quotes)
25+
- [Updating Package Version](#updating-package-version)
2526
- [Documentation](#documentation)
2627
- [Contributing to the Documentation](#contributing-to-the-documentation)
2728
- [Adding Examples to the Documentation](#adding-examples-to-the-documentation)
@@ -186,6 +187,14 @@ link checking.
186187
return re.search(r"(?i)(arr|avast|yohoho)!", message) is not None
187188
```
188189

190+
### Updating Package Version
191+
192+
The package version is derived automatically from Git tags by
193+
`setuptools_scm` (see `[tool.setuptools_scm]` in `pyproject.toml`), so there is
194+
no version string to edit by hand. To cut a release, tag the commit (for
195+
example, `git tag v1.2.3`) and push the tag; both the installed package version
196+
and the documentation's `version` and `release` values follow from it.
197+
189198
---
190199

191200
## Documentation

docs/source/architecture/decisions/0003-dependency-direction.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,10 @@ Compliance
4343
----------
4444

4545
``tests/architecture_test.py`` parses runtime imports and enforces the rules
46-
that hold today. It records these temporary variances exactly:
46+
that hold today. Its allowlist is the authoritative inventory of exact temporary
47+
cross-boundary imports; this ADR owns the direction and rationale rather than a
48+
second copy of that mutable inventory.
4749

48-
- ``wateruse`` imports generic pagination/sync and response-combining helpers
49-
from private OGC modules.
50-
- ``waterdata.utils`` re-exports private OGC helpers for existing internal
51-
callers and tests.
52-
- ``ogc.shaping`` lazily imports ``ogc.engine`` for schema/default-dialect
53-
behavior.
54-
55-
The allowlist may shrink as those seams move; adding a new variance requires an
56-
ADR update and explicit review.
50+
The allowlist should shrink as private seams move. Any growth requires explicit
51+
architecture review, and a change to the dependency policy requires this ADR to
52+
be superseded.

docs/source/architecture/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ remain visible until a shared transport policy replaces them deliberately.
191191
Known architectural debt
192192
------------------------
193193

194+
This view records categories and representative locations of debt. The fitness
195+
functions in ``tests/architecture_test.py`` are authoritative for exact current
196+
dependency allowlists.
197+
194198
- ``waterdata.utils`` re-exports many underscore-prefixed OGC helpers.
195199
- ``wateruse`` depends on private generic helpers located under ``ogc`` even
196200
though NWDC is not an OGC service.

docs/source/meta/contributing.rst

Lines changed: 8 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,13 @@
11
Contributing
22
============
33

4-
Contributions to ``dataretrieval`` are welcome and greatly appreciated, but
5-
please read this document before doing so.
4+
Contributions to ``dataretrieval`` are welcome. The repository's contributor
5+
requirements and development commands are maintained in `CONTRIBUTING.md`_.
6+
That file is the single source of truth for reporting issues, proposing
7+
changes, preparing pull requests, coding standards, testing, documentation,
8+
and release guidance.
69

10+
For the design constraints that apply to architecturally significant changes,
11+
see :doc:`../architecture/index` and its architecture decision records.
712

8-
Ways to contribute
9-
------------------
10-
11-
Reporting Bugs:
12-
^^^^^^^^^^^^^^^
13-
14-
Report bugs at https://github.com/DOI-USGS/dataretrieval-python/issues
15-
16-
When reporting a bug, please include:
17-
18-
- Detailed steps to reproduce the bug
19-
- Your operating system name and version.
20-
- Any details about your local setup that might be helpful in troubleshooting.
21-
22-
Fixing Bugs:
23-
^^^^^^^^^^^^
24-
25-
Look through the GitHub issues for bugs. Anything tagged as a "bug" is open to
26-
whomever wants to fix it.
27-
28-
29-
Implementing Features:
30-
^^^^^^^^^^^^^^^^^^^^^^
31-
32-
Look through the GitHub issues for features. Anything tagged with "enhancement"
33-
and "please-help" is open to whomever wants to implement it.
34-
35-
Please do not combine multiple feature enhancements into a single pull request.
36-
37-
Writing Documentation:
38-
^^^^^^^^^^^^^^^^^^^^^^
39-
40-
``dataretrieval`` could always use more documentation, whether as part of the
41-
official docs, in docstrings, or even in blog posts or articles.
42-
43-
Submitting Feedback:
44-
^^^^^^^^^^^^^^^^^^^^
45-
46-
The best way to send feedback is to file an issue at
47-
https://github.com/DOI-USGS/dataretrieval-python/issues
48-
49-
If you are proposing a feature:
50-
51-
- Explain in detail how it would work.
52-
- Keep the scope as narrow as possible, to make it easier to implement.
53-
54-
Contributor Guidelines
55-
----------------------
56-
57-
Pull Request Guidelines:
58-
^^^^^^^^^^^^^^^^^^^^^^^^
59-
60-
Before you submit a pull request, check that it meets these guidelines:
61-
62-
1. Changes to package functionality should include tests.
63-
2. Changes to behavior should update the relevant documentation or docstrings.
64-
3. The pull request should work for Python 3.10 and later and pass the GitHub
65-
Actions continuous integration pipelines.
66-
4. Build-related changes should preserve the installed-wheel smoke test; tests
67-
run from a source checkout do not prove that an artifact is complete.
68-
5. Architecturally significant changes should update :doc:`../architecture/index`,
69-
add or supersede an ADR, and adjust the corresponding fitness function.
70-
71-
72-
Updating Package Version:
73-
^^^^^^^^^^^^^^^^^^^^^^^^^^
74-
75-
Follow semantic versioning as best as possible. This means that changing the
76-
first digit of the version indicates a breaking change. Any smaller changes
77-
should attempt to maintain backwards-compatibility with previous code and
78-
issue deprecation warnings for features or functionality that will be removed
79-
or no longer be backwards-compatible in future releases.
80-
81-
The package version is derived automatically from Git tags by
82-
``setuptools_scm`` (see ``[tool.setuptools_scm]`` in ``pyproject.toml``), so
83-
there is no version string to edit by hand. To cut a release, tag the commit
84-
(for example, ``git tag v1.2.3``) and push the tag; both the installed package
85-
version and the documentation's ``version`` and ``release`` values (read via
86-
``importlib.metadata`` in ``docs/source/conf.py``) follow from it.
87-
88-
89-
Coding Standards
90-
----------------
91-
92-
Formatting, linting, and strict type checking are enforced by CI and the
93-
pre-commit configuration. Run ``ruff check .``, ``ruff format --check .``,
94-
``mypy``, and the relevant pytest suite before submitting a change.
95-
96-
- Follow PEP8 (https://peps.python.org/pep-0008/).
97-
- Docstrings should follow the NumPy standard (`example`_).
98-
- The public interface should emphasize functions over classes; classes can
99-
and should be used internally and in tests.
100-
- Group public download functions by data portal.
101-
- Preserve the dependency direction in :doc:`../architecture/index`:
102-
public facades depend on service/protocol adapters, which depend on stable
103-
shared policy and infrastructure. Shared OGC code must not import service
104-
adapters, and modern modules must not depend on legacy NWIS.
105-
- Treat underscore-prefixed helpers as implementation details. Existing
106-
cross-package uses are documented variances, not extension points.
107-
108-
.. _example: https://www.sphinx-doc.org/en/master/usage/extensions/example_numpy.html
109-
110-
- Example:
111-
112-
.. code:: python
113-
114-
def foo(param1, param2):
115-
"""Example function with types documented in the docstring.
116-
117-
A more detailed description of the function and its implementation.
118-
119-
Parameters
120-
----------
121-
param1 : int
122-
The first parameter.
123-
param2 : str
124-
The second parameter.
125-
126-
Returns
127-
-------
128-
bool
129-
True if successful, False otherwise.
130-
131-
Examples
132-
--------
133-
Examples should be written in doctest format and should demonstrate basic usage.
134-
135-
.. doctest::
136-
137-
>>> type(1) is int
138-
True
139-
140-
"""
141-
142-
- The public interface should emphasize functions over classes; however, classes can and should be used internally and in tests.
143-
- Functions for downloading data from a specific web portal must be grouped within their own submodule.
144-
- For example, all NWIS functions are located at :obj:`dataretrieval.nwis`.
145-
146-
- Quotes via http://stackoverflow.com/a/56190/5549:
147-
148-
- Use double quotes around strings that are used for interpolation or that are natural language messages
149-
- Use single quotes for small symbol-like strings (but break the rules if the strings contain quotes)
150-
- Use triple double quotes for doc-strings and raw string literals for regular expressions even if they aren't needed.
151-
152-
- Example:
153-
154-
.. code:: python
155-
156-
LIGHT_MESSAGES = {
157-
'English': "There are %(number_of_lights)s lights.",
158-
'Pirate': "Arr! Thar be %(number_of_lights)s lights."
159-
}
160-
161-
def lights_message(language, number_of_lights):
162-
"""Return a language-appropriate string reporting the light count."""
163-
return LIGHT_MESSAGES[language] % locals()
164-
165-
def is_pirate(message):
166-
"""Return True if the given message sounds piratical."""
167-
return re.search(r"(?i)(arr|avast|yohoho)!", message) is not None
168-
169-
170-
Acknowledgements
171-
----------------
172-
This document was adapted from the ``cookiecutter`` project's CONTRIBUTING file, which resides at
173-
https://github.com/cookiecutter/cookiecutter/blob/main/CONTRIBUTING.md
174-
Thank you to the ``cookiecutter`` team for helping streamline open-source development for the masses.
13+
.. _CONTRIBUTING.md: https://github.com/DOI-USGS/dataretrieval-python/blob/main/CONTRIBUTING.md

tests/architecture_test.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
)
2020

2121
# These top-level modules currently reach into OGC. NGWMN is an OGC adapter;
22-
# Water Use's imports are an accepted temporary variance recorded by ADR 0003.
23-
# Exact equality makes either growth or removal an intentional architecture
24-
# change that updates this fitness function and the ADR together.
22+
# Water Use's imports are an accepted temporary variance under ADR 0003. This
23+
# allowlist is the authoritative exact inventory; the ADR owns the policy and
24+
# rationale. Exact equality makes either growth or removal intentional.
2525
_ALLOWED_TOP_LEVEL_OGC_IMPORTS = {
2626
"dataretrieval.ngwmn": {"dataretrieval.ogc.engine"},
2727
"dataretrieval.wateruse": {
@@ -161,7 +161,8 @@ def test_top_level_ogc_consumers_match_documented_variances() -> None:
161161
observed[module] = dependencies
162162

163163
assert observed == _ALLOWED_TOP_LEVEL_OGC_IMPORTS, (
164-
"Top-level OGC dependencies differ from ADR 0003. Update the code, ADR, "
165-
"and allowlist together.\n"
164+
"Top-level OGC dependencies differ from the architecture allowlist. "
165+
"Update the code and allowlist; supersede ADR 0003 if the dependency "
166+
"policy changes.\n"
166167
f"expected={_ALLOWED_TOP_LEVEL_OGC_IMPORTS!r}\nobserved={observed!r}"
167168
)

0 commit comments

Comments
 (0)