From 4c061e67a0b3441f9c8e33ece81941e35101aa6a Mon Sep 17 00:00:00 2001 From: Kyle Hippe Date: Fri, 22 Dec 2023 00:41:11 +0000 Subject: [PATCH] Package init --- .github/ISSUE_TEMPLATE/01_bug.yml | 12 +- .github/ISSUE_TEMPLATE/02_enhancement.yml | 2 +- .github/ISSUE_TEMPLATE/03_docs.yml | 2 +- CITATION.cff | 10 -- README.md | 6 +- docs/_overrides/base.html | 8 - .../python/material/docstring/admonition.html | 5 - docs/_templates/python/material/function.html | 74 --------- docs/_templates/python/material/module.html | 67 -------- docs/contributing/index.md | 86 ---------- docs/contributing/issues-pull-requests.md | 36 ----- docs/contributing/releases.md | 33 ---- docs/contributing/style-guide.md | 22 --- docs/css/mkdocstrings.css | 65 -------- docs/examples.md | 12 -- docs/generate_api.py | 35 ---- docs/get-started.md | 19 --- docs/guides/example.md | 4 - docs/guides/index.md | 4 - docs/index.md | 1 - docs/installation.md | 5 - docs/known-issues.md | 4 - examples/README.md | 1 - examples/example.py | 31 ---- foobar/foo.py | 16 -- mkdocs.yml | 151 ------------------ {foobar => pdfwf}/__init__.py | 0 {foobar => pdfwf}/py.typed | 0 pyproject.toml | 15 +- testing/README.md | 2 +- tests/README.md | 2 +- tests/__init__.py | 2 +- tests/bar_test.py | 2 +- 33 files changed, 22 insertions(+), 712 deletions(-) delete mode 100644 CITATION.cff delete mode 100644 docs/_overrides/base.html delete mode 100644 docs/_templates/python/material/docstring/admonition.html delete mode 100644 docs/_templates/python/material/function.html delete mode 100644 docs/_templates/python/material/module.html delete mode 100644 docs/contributing/index.md delete mode 100644 docs/contributing/issues-pull-requests.md delete mode 100644 docs/contributing/releases.md delete mode 100644 docs/contributing/style-guide.md delete mode 100644 docs/css/mkdocstrings.css delete mode 100644 docs/examples.md delete mode 100644 docs/generate_api.py delete mode 100644 docs/get-started.md delete mode 100644 docs/guides/example.md delete mode 100644 docs/guides/index.md delete mode 100644 docs/index.md delete mode 100644 docs/installation.md delete mode 100644 docs/known-issues.md delete mode 100644 examples/README.md delete mode 100644 examples/example.py delete mode 100644 foobar/foo.py delete mode 100644 mkdocs.yml rename {foobar => pdfwf}/__init__.py (100%) rename {foobar => pdfwf}/py.typed (100%) diff --git a/.github/ISSUE_TEMPLATE/01_bug.yml b/.github/ISSUE_TEMPLATE/01_bug.yml index 3dae025..afc7494 100644 --- a/.github/ISSUE_TEMPLATE/01_bug.yml +++ b/.github/ISSUE_TEMPLATE/01_bug.yml @@ -2,20 +2,20 @@ name: Bug Report description: Report errors or unexpected results. labels: ["bug"] assignees: - - foobar-bug-assign-dev + - pdfwf-bug-assign-dev body: - type: textarea id: install attributes: - label: How did you install foobar? + label: How did you install pdfwf? description: > E.g., install via pip, install from source, etc. **Note:** this will be rendered as console text automatically. placeholder: | - $ pip install foobar - Collecting foobar + $ pip install pdfwf + Collecting pdfwf ... - Successfully installed foobar... + Successfully installed pdfwf... render: console validations: required: true @@ -23,7 +23,7 @@ body: - type: input id: version attributes: - label: What version of foobar are you using? + label: What version of pdfwf are you using? description: > Package version if installed via Pip or commit ID if installed from source. diff --git a/.github/ISSUE_TEMPLATE/02_enhancement.yml b/.github/ISSUE_TEMPLATE/02_enhancement.yml index b324e5b..6fafcd7 100644 --- a/.github/ISSUE_TEMPLATE/02_enhancement.yml +++ b/.github/ISSUE_TEMPLATE/02_enhancement.yml @@ -2,7 +2,7 @@ name: Enhancement Request description: Request a new feature or enhancement. labels: ["enhancement"] assignees: - - foobar-enh-assign-dev + - pdfwf-enh-assign-dev body: - type: textarea id: request diff --git a/.github/ISSUE_TEMPLATE/03_docs.yml b/.github/ISSUE_TEMPLATE/03_docs.yml index e6d1d82..fc6708b 100644 --- a/.github/ISSUE_TEMPLATE/03_docs.yml +++ b/.github/ISSUE_TEMPLATE/03_docs.yml @@ -2,7 +2,7 @@ name: Documentation Improvements description: Suggest improvements to the documentation. labels: ["documentation"] assignees: - - foobar-doc-assignee-dev + - pdfwf-doc-assignee-dev body: - type: textarea id: freeform diff --git a/CITATION.cff b/CITATION.cff deleted file mode 100644 index 7a0f4a2..0000000 --- a/CITATION.cff +++ /dev/null @@ -1,10 +0,0 @@ -cff-version: 1.2.0 -message: If you use this software, please cite it as below. -authors: - - family-names: Pauloski - given-names: Greg - orcid: https://orcid.org/0000-0002-6547-6902 -license: MIT -repository-code: https://github.com/foobar-author/foobar -title: FooBar -url: https://foobar.dev diff --git a/README.md b/README.md index 8d4b624..d5d9de5 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ This package setup was based on [Anthony Sottile's project setup](https://www.yo 1. Click the "Use this template" button at the top right of this page. 2. Delete and directories you will not be using (commonly `docs/` if you do not want to use MKDocs or `examples/` if you will not have example code). 3. Follow the instructions to create the new repo then clone your repo locally. -4. The template uses "foobar" to indicate things that need to be changed. - Start by searching for all instances (`git grep foobar`) and changing them accordingly. +4. The template uses "pdfwf" to indicate things that need to be changed. + Start by searching for all instances (`git grep pdfwf`) and changing them accordingly. 5. Configure pre-commit: - Go to [https://pre-commit.ci/](https://pre-commit.ci/) and enable pre-commit on your repo. - Update the pre-commit badge URL in this README with your new badge URL. @@ -49,7 +49,7 @@ I recommend making a few other changes to the repo's setting on GitHub. Install via pip: ``` -$ pip install foobar +$ pip install pdfwf ``` For local development: diff --git a/docs/_overrides/base.html b/docs/_overrides/base.html deleted file mode 100644 index 0af326a..0000000 --- a/docs/_overrides/base.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base.html" %} - -{% block outdated %} - You're not viewing the latest version. - - Click here to go to latest. - -{% endblock %} diff --git a/docs/_templates/python/material/docstring/admonition.html b/docs/_templates/python/material/docstring/admonition.html deleted file mode 100644 index 2105eab..0000000 --- a/docs/_templates/python/material/docstring/admonition.html +++ /dev/null @@ -1,5 +0,0 @@ -{{ log.debug("Rendering admonition") }} -
- {{ section.title|convert_markdown(heading_level, html_id, strip_paragraph=True) }} - {{ section.value.contents|convert_markdown(heading_level, html_id) }} -
diff --git a/docs/_templates/python/material/function.html b/docs/_templates/python/material/function.html deleted file mode 100644 index 04f9fbd..0000000 --- a/docs/_templates/python/material/function.html +++ /dev/null @@ -1,74 +0,0 @@ -{{ log.debug("Rendering " + function.path) }} - -
-{% with html_id = function.path %} - - {% if root %} - {% set show_full_path = config.show_root_full_path %} - {% set root_members = True %} - {% elif root_members %} - {% set show_full_path = config.show_root_members_full_path or config.show_object_full_path %} - {% set root_members = False %} - {% else %} - {% set show_full_path = config.show_object_full_path %} - {% endif %} - - {% if not root or config.show_root_heading %} - - {% filter heading(heading_level, - role="function", - id=html_id, - class="doc doc-heading", - toc_label=function.name ~ "()") %} - - {% if config.separate_signature %} - {% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %}() - {% else %} - {% filter highlight(language="python", inline=True) %} - {% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %}() - {% include "signature.html" with context %} - {% endfilter %} - {% endif %} - - {% with labels = function.labels %} - {% include "labels.html" with context %} - {% endwith %} - - {% endfilter %} - - {% if config.separate_signature %} - {% filter highlight(language="python", inline=False) %} - {% filter format_signature(function, config.line_length, crossrefs=config.signature_crossrefs) %} - {% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %} - {% include "signature.html" with context %} - {% endfilter %} - {% endfilter %} - {% endif %} - - {% else %} - {% if config.show_root_toc_entry %} - {% filter heading(heading_level, - role="function", - id=html_id, - toc_label=function.path if config.show_root_full_path else function.name, - hidden=True) %} - {% endfilter %} - {% endif %} - {% set heading_level = heading_level - 1 %} - {% endif %} - -
- {% with docstring_sections = function.docstring.parsed %} - {% include "docstring.html" with context %} - {% endwith %} - - {% if config.show_source and function.source %} -
- Source code in {{ function.relative_filepath }} - {{ function.source|highlight(language="python", linestart=function.lineno, linenums=True) }} -
- {% endif %} -
- -{% endwith %} -
diff --git a/docs/_templates/python/material/module.html b/docs/_templates/python/material/module.html deleted file mode 100644 index 6538723..0000000 --- a/docs/_templates/python/material/module.html +++ /dev/null @@ -1,67 +0,0 @@ -{{ log.debug("Rendering " + module.path) }} - -
-{% with html_id = module.path %} - - {% if root %} - {% set show_full_path = config.show_root_full_path %} - {% set root_members = True %} - {% elif root_members %} - {% set show_full_path = config.show_root_members_full_path or config.show_object_full_path %} - {% set root_members = False %} - {% else %} - {% set show_full_path = config.show_object_full_path %} - {% endif %} - - {% if not root or config.show_root_heading %} - - {% filter heading(heading_level, - role="module", - id=html_id, - class="doc doc-heading", - toc_label=module.name) %} - - {% with module_name = module.path if show_full_path else module.name %} - {% if config.separate_signature %} - {{ module_name }} - {% else %} - {{ module_name }} - {% endif %} - {% endwith %} - - {% with labels = module.labels %} - {% include "labels.html" with context %} - {% endwith %} - - {% endfilter %} - - {% else %} - {% if config.show_root_toc_entry %} - {% filter heading(heading_level, - role="module", - id=html_id, - toc_label=module.path if config.show_root_full_path else module.name, - hidden=True) %} - {% endfilter %} - {% endif %} - {% set heading_level = heading_level - 1 %} - {% endif %} - -

- Source file: {{ module.filepath }} -

- -
- {% with docstring_sections = module.docstring.parsed %} - {% include "docstring.html" with context %} - {% endwith %} - - {% with obj = module %} - {% set root = False %} - {% set heading_level = heading_level + 1 %} - {% include "children.html" with context %} - {% endwith %} -
- -{% endwith %} -
diff --git a/docs/contributing/index.md b/docs/contributing/index.md deleted file mode 100644 index 956e342..0000000 --- a/docs/contributing/index.md +++ /dev/null @@ -1,86 +0,0 @@ -## Getting Started for Local Development - -We recommend using [Tox](https://tox.wiki/en/latest/index.html){target=_blank} -to setup the development environment. This will create a new virtual -environment with all of the required packages installed -and FooBar installed in editable mode with the necessary extras options. - -```bash -$ git clone https://github.com/foobar-author/foobar -$ cd foobar -$ tox --devenv venv -e py310 -$ . venv/bin/activate -``` - -!!! warning - - Running Tox in a Conda environment is possible but it may conflict with - Tox's ability to find the correct Python versions. E.g., if your - Conda environment is Python 3.9, running `#!bash $ tox -e p38` may still use - Python 3.9. - -To install manually: -```bash -$ git clone https://github.com/foobar-author/foobar -$ cd foobar -$ python -m venv venv -$ . venv/bin/activate -$ pip install -e .[dev,docs] -``` - -## Continuous Integration - -FooBar uses [pre-commit](https://pre-commit.com/){target=_blank} and -[Tox](https://tox.wiki/en/latest/index.html){target=_blank} for continuous integration -(test, linting, etc.). - -### Linting and Type Checking (pre-commit) - -To use pre-commit, install the hook and then run against files. - -```bash -$ pre-commit install -$ pre-commit run --all-files -``` - -### Tests (tox) - -The entire CI workflow can be run with `#!bash $ tox`. -This will test against multiple versions of Python and can be slow. - -Module-level unit-test are located in the `tests/` directory and its -structure is intended to match that of `foobar/`. -E.g. the tests for `foobar/x/y.py` are located in -`tests/x/y_test.py`; however, additional test files can be added -as needed. Tests should be narrowly focused and target a single aspect of the -code's functionality, tests should not test internal implementation details of -the code, and tests should not be dependent on the order in which they are run. - -Code that is useful for building tests but is not a test itself belongs in the -`testing/` directory. - -```bash -# Run all tests in tests/ -$ tox -e py39 -# Run a specific test -$ tox -e py39 -- tests/x/y_test.py::test_z -``` - -## Docs - -If code changes require an update to the documentation (e.g., for function -signature changes, new modules, etc.), the documentation can be built using -MKDocs. - -```bash -# Manually -$ pip install -e .[docs] -$ mkdocs build --strict # Build only to site/index.html -$ mkdocs serve # Serve locally - -# With tox (will only build, does not serve) -$ tox -e docs -``` - -Docstrings are automatically generated, but it is recommended to check the -generated docstrings to make sure details/links/etc. are correct. diff --git a/docs/contributing/issues-pull-requests.md b/docs/contributing/issues-pull-requests.md deleted file mode 100644 index 27248c9..0000000 --- a/docs/contributing/issues-pull-requests.md +++ /dev/null @@ -1,36 +0,0 @@ -## Issues - -[Issue Tracker](https://github.com/foobar-author/foobar/issues){target=_blank} - -We use GitHub issues to report problems, request and track changes, and discuss -future ideas. -If you open an issue for a specific problem, please follow the template guides. - -## Pull Requests - -We use the standard GitHub contribution cycle where all contributions are -made via pull requests (including code owners!). - -1. Fork the repository and clone to your local machine. -2. Create local changes. - - Changes should conform to the style and testing guidelines, referenced - above. - - Preferred commit message format ([source](https://cbea.ms/git-commit/){target=_blank}): - * separate subject from body with a blank line, - * limit subject line to 50 characters, - * capitalize first word of subject line, - * do not end the subject line with a period, - * use the imperative mood for subject lines, - * include related issue numbers at end of subject line, - * wrap body at 72 characters, and - * use the body to explain what/why rather than how. - Example: `Fix concurrency bug in Store (#42)` -3. Push commits to your fork. - - Please squash commits fixing mistakes to keep the git history clean. - For example, if commit "b" follows commit "a" and only fixes a small typo - from "a", please squash "a" and "b" into a single, correct commit. - This keeps the commit history readable and easier to search through when - debugging (e.g., git blame/bisect). -4. Open a pull request in this repository. - - The pull request should include a description of the motivation for the - PR and included changes. A PR template is provided to guide this process. diff --git a/docs/contributing/releases.md b/docs/contributing/releases.md deleted file mode 100644 index 13ba765..0000000 --- a/docs/contributing/releases.md +++ /dev/null @@ -1,33 +0,0 @@ -## Release Timeline - -Releases are created on an as-needed basis. -Milestones are the [Issue Tracker](https://github.com/foobar-author/foobar/issues){target=_blank} are used to track features to be included in upcoming releases. - -## Creating Releases - -1. Choose the next version number, referred to as `{VERSION}` for the - rest of the instructions. Versioning follows semver - (`major.minor.patch`) with optional [PEP-440](https://peps.python.org/pep-0440){target=_blank} - pre-release/post-release/dev-release segments. Major/minor/patch numbers - start at 0 and pre-release/post-release/dev-release segments start at 1. -2. Update the version in `pyproject.toml` to `{VERSION}`. -3. Commit and merge the version updates/changelogs into main. -4. Tag the release commit and push (typically this is the commit updating the - version numbers). - ```bash - $ git tag -s v{VERSION} -m "FooBar v{VERSION}" - $ git push origin v{VERSION} - ``` - Note the version number is prepended by "v" for the tags so we can - distinguish release tags from non-release tags. -5. Create a new release on GitHub using the tag. The title should be - `FooBar v{VERSION}`. -6. **Official release:** - 1. Use the "Generate release notes" option and set the previous tag as the previous official release tag. E.g., for `v0.4.1`, the previous release tag should be `v0.4.0` and NOT `v0.4.1a1`. - 2. Add an "Upgrade Steps" section at the top (see previous releases for examples). - 3. Review the generated notes and edit as needed. PRs are organized by tag, but some PRs will be missing tags and need to be moved from the "Other Changes" section to the correct section. - 4. Select "Set as the latest release." -7. **Unofficial release:** (alpha/dev builds) - 1. Do NOT generate release notes. The body can be along the lines of "Development pre-prelease for `V{VERSION}`." - 2. Leave the previous tag as "auto." - 3. Select "Set as a pre-release." diff --git a/docs/contributing/style-guide.md b/docs/contributing/style-guide.md deleted file mode 100644 index 8dc71a3..0000000 --- a/docs/contributing/style-guide.md +++ /dev/null @@ -1,22 +0,0 @@ -The Python code and docstring format mostly follows Google's -[Python Style Guide](https://google.github.io/styleguide/pyguide.html){target=_blank}, -but the pre-commit config is the authoritative source for code format -compliance. - -**Nits:** - -* Avoid imports in `__init__.py` (reduces the likelihood of circular imports). -* Prefer pure functions where possible. -* Define all class attributes inside `__init__` so all attributes are visible - in one place. Attributes that are defined later can be set as `None` - as a placeholder. -* Prefer f-strings (`#!python f'name: {name}`) over string format - (`#!python 'name: {}'.format(name)`). Never use the `%` operator. -* Prefer [typing.NamedTuple][] over [collections.namedtuple][]. -* Use lower-case and no punctuation for log messages, but use upper-case and - punctuation for exception values. - ```python - logger.info(f'new connection opened to {address}') - raise ValueError('Name must contain alphanumeric characters only.') - ``` -* Document all exceptions that may be raised by a function in the docstring. diff --git a/docs/css/mkdocstrings.css b/docs/css/mkdocstrings.css deleted file mode 100644 index eef576e..0000000 --- a/docs/css/mkdocstrings.css +++ /dev/null @@ -1,65 +0,0 @@ -/* Don't capitalize names. */ -h5.doc-heading { - text-transform: none !important; -} - -/* Avoid breaking parameters name, etc. in table cells. */ -.doc-contents td code { - word-break: normal !important; -} - -/* For pieces of Markdown rendered in table cells. */ -.doc-contents td p { - margin-top: 0 !important; - margin-bottom: 0 !important; -} - -/* Max width for docstring sections tables. */ -.doc .md-typeset__table, -.doc .md-typeset__table table { - display: table !important; - width: 100%; -} -.doc .md-typeset__table tr { - display: table-row; -} - -/* Avoid line breaks in rendered fields. */ -.field-body p { - display: inline; -} - -/* Defaults in Spacy table style. */ -.doc-param-default { - float: right; -} - -span.doc.doc-object-name { - font-weight: 400; - font-family: var(--md-code-font-family); -} - -h2.doc.doc-heading { - border-bottom-style: solid; - border-color: var(--md-default-fg-color--lighter); - border-width: 2px; -} - -h3.doc.doc-heading { - border-bottom-style: dashed; - border-color: var(--md-default-fg-color--lighter); - border-width: 1px; -} - -span.doc.doc-object-name.doc-function-name { - font-style: normal; -} - -/* -div.doc.doc-object.doc-class { - border-bottom-style: solid; - border-top-style: solid; - border-color: var(--md-code-bg-color); - border-width: 1px; -} -*/ diff --git a/docs/examples.md b/docs/examples.md deleted file mode 100644 index 4793c2a..0000000 --- a/docs/examples.md +++ /dev/null @@ -1,12 +0,0 @@ -# Examples - -## foobar - -foobar can be used as follows. - -```python -from foobar import foo - -foo.bar([1, 2, 3]) -# output: 6 -``` diff --git a/docs/generate_api.py b/docs/generate_api.py deleted file mode 100644 index b32966e..0000000 --- a/docs/generate_api.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Generate the code reference pages and navigation.""" -from __future__ import annotations - -from pathlib import Path - -import mkdocs_gen_files - -nav = mkdocs_gen_files.Nav() - -PACKAGE_DIR = 'foobar/' - -for path in sorted(Path(PACKAGE_DIR).rglob('**/*.py')): - module_path = path.with_suffix('') - doc_path = path.relative_to(PACKAGE_DIR).with_suffix('.md') - full_doc_path = Path('api', doc_path) - - parts = tuple(module_path.parts) - parts = tuple('.'.join(parts[: i + 1]) for i in range(len(parts))) - - if parts[-1].endswith('__init__'): - parts = parts[:-1] - doc_path = doc_path.with_name('index.md') - full_doc_path = full_doc_path.with_name('index.md') - elif parts[-1].endswith('__main__'): - continue - - nav[parts] = doc_path.as_posix() - - with mkdocs_gen_files.open(full_doc_path, 'w') as fd: - fd.write(f'::: {parts[-1]}') - - mkdocs_gen_files.set_edit_path(full_doc_path, path) - -with mkdocs_gen_files.open('api/SUMMARY.md', 'w') as nav_file: - nav_file.writelines(nav.build_literate_nav()) diff --git a/docs/get-started.md b/docs/get-started.md deleted file mode 100644 index 7248f9c..0000000 --- a/docs/get-started.md +++ /dev/null @@ -1,19 +0,0 @@ -# Quick Start - -foobar brief description. - -## Overview - -foobar detailed overview. - -## Installation - -```bash -$ pip install foobar -``` - -Documentation on installing for local development is provided in [Contributing](contributing/index.md). - -## Usage - -foobar usage example. diff --git a/docs/guides/example.md b/docs/guides/example.md deleted file mode 100644 index cd39a7c..0000000 --- a/docs/guides/example.md +++ /dev/null @@ -1,4 +0,0 @@ -Example Guide -############# - -Add your example guide here. diff --git a/docs/guides/index.md b/docs/guides/index.md deleted file mode 100644 index e62250f..0000000 --- a/docs/guides/index.md +++ /dev/null @@ -1,4 +0,0 @@ -# Guides - - -- [Examples](example.md) diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 612c7a5..0000000 --- a/docs/index.md +++ /dev/null @@ -1 +0,0 @@ ---8<-- "README.md" diff --git a/docs/installation.md b/docs/installation.md deleted file mode 100644 index 9ffd745..0000000 --- a/docs/installation.md +++ /dev/null @@ -1,5 +0,0 @@ -# Installation - -```bash -$ pip install foobar -``` diff --git a/docs/known-issues.md b/docs/known-issues.md deleted file mode 100644 index f12a337..0000000 --- a/docs/known-issues.md +++ /dev/null @@ -1,4 +0,0 @@ -# Known Issues - -- First known issue. -- Second known issue. diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index 0a01927..0000000 --- a/examples/README.md +++ /dev/null @@ -1 +0,0 @@ -# foobar Examples diff --git a/examples/example.py b/examples/example.py deleted file mode 100644 index 7ba4134..0000000 --- a/examples/example.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Example script that uses the foobar package.""" -from __future__ import annotations - -import argparse - -from foobar.foo import bar - - -def main() -> int: - """Script entry point.""" - parser = argparse.ArgumentParser() - parser.add_argument( - '-n', - '--numbers', - nargs='+', - type=int, - default=None, - help='List of integers to sum', - ) - args = parser.parse_args() - - result = bar(args.numbers) - - print(f'Input: {args.numbers}') - print(f'Result: {result}') - - return 0 - - -if __name__ == '__main__': - raise SystemExit(main()) diff --git a/foobar/foo.py b/foobar/foo.py deleted file mode 100644 index c75b83c..0000000 --- a/foobar/foo.py +++ /dev/null @@ -1,16 +0,0 @@ -"""foo module.""" -from __future__ import annotations - - -def bar(data: list[int] | None = None) -> int | None: - """Sum list of integers. - - Args: - data (list[int], None): optional list of integers (default: None). - - Returns: - `None` if `data=None` else the integer sum of `data`. - """ - if data is not None: - return sum(data) - return None diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index 1f632c8..0000000 --- a/mkdocs.yml +++ /dev/null @@ -1,151 +0,0 @@ -site_name: Python Template -site_url: https://gpauloski.github.io/python-template -site_author: FooBar Author -site_description: Documentation for FooBar. - -repo_name: gpauloski/python-template -repo_url: https://github.com/gpauloski/python-template - -copyright: Copyright © 2023—Present FooBar Authors - -theme: - name: material - features: - - content.code.annotate - - content.code.copy - - navigation.path - - navigation.sections - - navigation.tabs - - navigation.top - - navigation.tracking - - search.highlight - - search.share - - search.suggest - - toc.follow - font: - text: Open Sans - code: Roboto Mono - palette: - # Palette toggle for automatic mode - - media: "(prefers-color-scheme)" - scheme: default - primary: red - accent: blue - toggle: - icon: material/brightness-auto - name: Switch to light mode - - # Palette toggle for light mode - - media: "(prefers-color-scheme: light)" - scheme: default - primary: red - accent: blue - toggle: - icon: material/brightness-7 - name: Switch to dark mode - - # Palette toggle for dark mode - - media: "(prefers-color-scheme: dark)" - scheme: slate - primary: red - accent: blue - toggle: - icon: material/brightness-4 - name: Switch to system preference - overrides: docs/_overrides - # favicon: static/favicon.png - # icon: - # logo: logo - -watch: - - mkdocs.yml - - README.md - - docs/ - - foobar/ - -extra: - version: - default: latest - provider: mike - -extra_css: - - css/mkdocstrings.css - -markdown_extensions: - - admonition - - attr_list - - md_in_html - - toc: - permalink: true - - pymdownx.arithmatex: - generic: true - - pymdownx.betterem: - smart_enable: all - - pymdownx.details - - pymdownx.highlight: - anchor_linenums: true - line_spans: __span - pygments_lang_class: true - - pymdownx.inlinehilite - - pymdownx.keys - - pymdownx.magiclink: - repo_url_shorthand: true - user: foobar-author - repo: foobar - - pymdownx.mark - - pymdownx.smartsymbols - - pymdownx.snippets: - check_paths: true - - pymdownx.superfences - - pymdownx.tabbed: - alternate_style: true - - pymdownx.tasklist: - custom_checkbox: true - -nav: - - Home: - - Overview: index.md - - Installation: installation.md - - Get Started: get-started.md - - Examples: examples.md - - Known Issues: known-issues.md - - Changelog (GitHub): https://github.com/gpauloski/python-template/releases - - Guides: - - guides/index.md - - Example: guides/example.md - - API Reference: api/ - - Contributing: - - contributing/index.md - - Style Guide: contributing/style-guide.md - - Issues and Pull Requests: contributing/issues-pull-requests.md - - Releases: contributing/releases.md - -plugins: - - gen-files: - scripts: - - docs/generate_api.py - - literate-nav: - nav_file: SUMMARY.md - - mkdocstrings: - custom_templates: docs/_templates - enable_inventory: true - handlers: - python: - setup_commands: - - import pytkdocs_tweaks - - pytkdocs_tweaks.main() - import: - - https://docs.python.org/3/objects.inv - options: - docstring_section_style: list - docstring_style: google - inherited_members: yes - line_length: 60 - members_order: source - merge_init_into_class: yes - separate_signature: yes - show_root_full_path: yes - show_signature_annotations: yes - show_submodules: no - - search - - section-index diff --git a/foobar/__init__.py b/pdfwf/__init__.py similarity index 100% rename from foobar/__init__.py rename to pdfwf/__init__.py diff --git a/foobar/py.typed b/pdfwf/py.typed similarity index 100% rename from foobar/py.typed rename to pdfwf/py.typed diff --git a/pyproject.toml b/pyproject.toml index 93a1f45..9976547 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,13 +3,13 @@ requires = ["setuptools>=64.0", "setuptools_scm"] build-backend = "setuptools.build_meta" [project] -name = "foobar" +name = "pdfwf" version = "0.1.0" authors = [ - {name = "foobar author"}, - {email = "foobar@foobar.com"}, + {name = "Kyle Hippe"}, + {email = "khippe@anl.gov"}, ] -description = "Foobar example package." +description = "Workflow for running pdf to text conversions at scale" readme = "README.md" requires-python = ">=3.8" license = {text = "MIT"} @@ -24,9 +24,8 @@ dependencies = [ ] [project.urls] -homepage = "https://github.com/foobar-author/foobar" -documentation = "https://foobar.readthedocs.io" -repository = "https://github.com/foobar-author/foobar" +homepage = "https://github.com/ramanathanlab/pdfwf" +repository = "https://github.com/ramanathanlab/pdfwf" [project.optional-dependencies] dev = [ @@ -138,7 +137,7 @@ quote-style = "single" [tool.ruff.isort] force-single-line = true -known-first-party = ["foobar", "test", "testing"] +known-first-party = ["pdfwf", "test", "testing"] order-by-type = false required-imports = ["from __future__ import annotations"] diff --git a/testing/README.md b/testing/README.md index 5931963..78bc6e4 100644 --- a/testing/README.md +++ b/testing/README.md @@ -1,4 +1,4 @@ -# Testing infrastructure for foobar +# Testing infrastructure for `pdfwf` Code that is useful for creating and running tests but is not a test itself. Test infrastructure may include items like mock object, test runners, example data, and more. diff --git a/tests/README.md b/tests/README.md index 5c59416..53bcb3a 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,4 +1,4 @@ -# Tests for foobar +# Tests for `pdfwf` Test files should take the form `*_test.py` and tests inside files should be top-level functions named `test_*()`. diff --git a/tests/__init__.py b/tests/__init__.py index 00e4e8d..2f2a50c 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,2 +1,2 @@ -"""foobar unit tests.""" +"""pdfwf unit tests.""" from __future__ import annotations diff --git a/tests/bar_test.py b/tests/bar_test.py index 1efd58b..0a42e75 100644 --- a/tests/bar_test.py +++ b/tests/bar_test.py @@ -2,7 +2,7 @@ import pytest -from foobar.foo import bar +from pdfwf.foo import bar from testing.data import DATA