robot_obo_tool 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ """A wrapper around ROBOT."""
2
+
3
+ from .api import ROBOT_VERSION, ROBOTError, call, convert, ensure_jar, is_available
4
+
5
+ __all__ = [
6
+ "ROBOT_VERSION",
7
+ "ROBOTError",
8
+ "call",
9
+ "convert",
10
+ "ensure_jar",
11
+ "is_available",
12
+ ]
robot_obo_tool/api.py ADDED
@@ -0,0 +1,232 @@
1
+ """A wrapper around ROBOT functionality.
2
+
3
+ .. seealso:: https://robot.obolibrary.org
4
+ """
5
+
6
+ import logging
7
+ import os
8
+ import subprocess
9
+ from pathlib import Path
10
+ from shutil import which
11
+ from subprocess import check_output
12
+ from textwrap import indent, shorten
13
+ from typing import Literal
14
+
15
+ import pystow
16
+
17
+ __all__ = [
18
+ "ROBOT_VERSION",
19
+ "ROBOTError",
20
+ "call",
21
+ "convert",
22
+ "ensure_jar",
23
+ "is_available",
24
+ ]
25
+
26
+ logger = logging.getLogger(__name__)
27
+
28
+ #: The default ROBOT version to download
29
+ ROBOT_VERSION = "1.9.8"
30
+ ROBOT_MODULE = pystow.module("robot")
31
+
32
+
33
+ def ensure_jar(*, version: str | None = None) -> Path:
34
+ """Ensure the ROBOT JAR is cached."""
35
+ if version is None:
36
+ version = ROBOT_VERSION
37
+ url = f"https://github.com/ontodev/robot/releases/download/v{version}/robot.jar"
38
+ return ROBOT_MODULE.ensure(url=url, version=version)
39
+
40
+
41
+ def is_available(*, version: str | None = None) -> bool:
42
+ """Check if ROBOT is available."""
43
+ if which("java") is None:
44
+ # suggested in https://stackoverflow.com/questions/11210104/check-if-a-program-exists-from-a-python-script
45
+ logger.error("java is not on the PATH")
46
+ return False
47
+
48
+ try:
49
+ check_output(["java", "--help"]) # noqa: S607
50
+ except Exception:
51
+ logger.error(
52
+ "java --help failed - this means the java runtime environment (JRE) "
53
+ "might not be configured properly"
54
+ )
55
+ return False
56
+
57
+ robot_jar_path = ensure_jar(version=version)
58
+ if not robot_jar_path.is_file():
59
+ logger.error("ROBOT was not successfully downloaded to %s", robot_jar_path)
60
+ # ROBOT was unsuccessfully downloaded
61
+ return False
62
+
63
+ try:
64
+ call("--help")
65
+ except Exception:
66
+ logger.error("ROBOT was downloaded to %s but could not be run with --help", robot_jar_path)
67
+ return False
68
+
69
+ return True
70
+
71
+
72
+ def call(*args: str, version: str | None = None) -> str:
73
+ """Run a ROBOT command and return the output as a string."""
74
+ rr = ["java", "-jar", str(ensure_jar(version=version)), *args]
75
+ logger.debug("Running shell command: %s", rr)
76
+ try:
77
+ ret = check_output( # noqa:S603
78
+ rr,
79
+ cwd=os.path.dirname(__file__),
80
+ stderr=subprocess.PIPE,
81
+ )
82
+ except subprocess.CalledProcessError as e:
83
+ raise ROBOTError(
84
+ command=e.cmd,
85
+ return_code=e.returncode,
86
+ output=e.output.decode() if e.output is not None else None,
87
+ stderr=e.stderr.decode() if e.stderr is not None else None,
88
+ ) from None
89
+
90
+ return ret.decode()
91
+
92
+
93
+ def convert(
94
+ input_path: str | Path,
95
+ output_path: str | Path,
96
+ input_flag: Literal["-i", "-I"] | None = None,
97
+ *,
98
+ merge: bool = False,
99
+ fmt: str | None = None,
100
+ check: bool = True,
101
+ reason: bool = False,
102
+ extra_args: list[str] | None = None,
103
+ debug: bool = False,
104
+ version: str | None = None,
105
+ ) -> str:
106
+ """Convert an OBO file to an OWL file with ROBOT.
107
+
108
+ :param input_path: Either a local file path or IRI. If a local file path
109
+ is used, pass ``"-i"`` to ``flag``. If an IRI is used, pass ``"-I"``
110
+ to ``flag``.
111
+ :param output_path: The local file path to save the converted ontology to.
112
+ Will infer format from the extension, otherwise, use the ``fmt`` param.
113
+ :param input_flag: The flag to denote if the file is local or remote.
114
+ Tries to infer from input string if none is given
115
+ :param merge: Use ROBOT's merge command to squash all graphs together
116
+ :param fmt: Explicitly set the format
117
+ :param check:
118
+ By default, the OBO writer strictly enforces
119
+ `document structure rules <http://owlcollab.github.io/oboformat/doc/obo-syntax.html#4>`.
120
+ If an ontology violates these, the convert to OBO operation will fail.
121
+ These checks can be ignored by setting this to false.
122
+ :param reason:
123
+ Turn on ontology reasoning
124
+ :param extra_args:
125
+ Extra positional arguments to pass in the command line
126
+ :param debug:
127
+ Turn on -vvv
128
+ :param version: the version of ROBOT to use
129
+ :return: Output from standard out from running ROBOT
130
+ """
131
+ if input_flag is None:
132
+ input_flag = "-I" if _is_remote(input_path) else "-i"
133
+
134
+ args: list[str] = []
135
+
136
+ if merge and not reason:
137
+ args.extend(["merge", str(input_flag), str(input_path), "convert"])
138
+ elif merge and reason:
139
+ args.extend(
140
+ [
141
+ "merge",
142
+ str(input_flag),
143
+ str(input_path),
144
+ "reason",
145
+ "convert",
146
+ ]
147
+ )
148
+ elif not merge and reason:
149
+ args.extend(
150
+ [
151
+ "reason",
152
+ str(input_flag),
153
+ str(input_path),
154
+ "convert",
155
+ ]
156
+ )
157
+ else:
158
+ args.extend(
159
+ [
160
+ "convert",
161
+ str(input_flag),
162
+ str(input_path),
163
+ ]
164
+ )
165
+
166
+ args.extend(("-o", str(output_path)))
167
+ if extra_args:
168
+ args.extend(extra_args)
169
+ if not check:
170
+ args.append("--check=false")
171
+ if fmt:
172
+ args.extend(("--format", fmt))
173
+ if debug:
174
+ args.append("-vvv")
175
+
176
+ return call(*args, version=version)
177
+
178
+
179
+ #: Prefixes that denote remote resources
180
+ PROTOCOLS = {
181
+ "https://",
182
+ "http://",
183
+ "ftp://",
184
+ "ftps://",
185
+ }
186
+
187
+
188
+ def _is_remote(url: str | Path) -> bool:
189
+ return isinstance(url, str) and any(url.startswith(protocol) for protocol in PROTOCOLS)
190
+
191
+
192
+ class ROBOTError(Exception):
193
+ """Custom error for ROBOT command failures that includes output preview."""
194
+
195
+ def __init__(
196
+ self,
197
+ command: list[str],
198
+ return_code: int,
199
+ output: str | None = None,
200
+ stderr: str | None = None,
201
+ preview_length: int = 500,
202
+ ) -> None:
203
+ """Initialize a wrapper around a ROBOT exception.
204
+
205
+ :param command: The command that was executed and failed
206
+ :param return_code: The exit code returned by the command
207
+ :param output: The stdout/stderr output from the command execution
208
+ :param preview_length:
209
+ Maximum number of characters to include in the
210
+ error message preview. Default is 500 characters.
211
+
212
+ The error message will contain the command, return code, and a preview
213
+ of the output truncated to preview_length characters.
214
+ """
215
+ self.command = command
216
+ self.return_code = return_code
217
+ self.stdout = output or "<no stdout>"
218
+ self.preview_length = preview_length
219
+ self.stderr = stderr or "<no stderr>"
220
+
221
+ # Create the error message
222
+ command_str = " ".join(command)
223
+ stdout_preview = indent(shorten(self.stdout, preview_length), " ")
224
+ stderr_preview = indent(shorten(self.stderr, preview_length), " ")
225
+
226
+ message = (
227
+ f"Command `{command_str}` returned non-zero exit status {return_code}.\n\n"
228
+ f"stderr:\n\n{stderr_preview}"
229
+ f"\n\nstdout:\n\n{stdout_preview}"
230
+ )
231
+
232
+ super().__init__(message)
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,39 @@
1
+ """Version information for :mod:`robot_obo_tool`.
2
+
3
+ Run with ``python -m robot_obo_tool.version``
4
+ """
5
+
6
+ import os
7
+ from subprocess import CalledProcessError, check_output
8
+
9
+ __all__ = [
10
+ "VERSION",
11
+ "get_git_hash",
12
+ "get_version",
13
+ ]
14
+
15
+ VERSION = "0.0.1"
16
+
17
+
18
+ def get_git_hash() -> str:
19
+ """Get the :mod:`robot_obo_tool` git hash."""
20
+ with open(os.devnull, "w") as devnull:
21
+ try:
22
+ ret = check_output(
23
+ ["git", "rev-parse", "HEAD"],
24
+ cwd=os.path.dirname(__file__),
25
+ stderr=devnull,
26
+ )
27
+ except CalledProcessError:
28
+ return "UNHASHED"
29
+ else:
30
+ return ret.strip().decode("utf-8")[:8]
31
+
32
+
33
+ def get_version(with_git_hash: bool = False) -> str:
34
+ """Get the :mod:`robot_obo_tool` version string, including a git hash."""
35
+ return f"{VERSION}-{get_git_hash()}" if with_git_hash else VERSION
36
+
37
+
38
+ if __name__ == "__main__":
39
+ print(get_version(with_git_hash=True)) # noqa:T201
@@ -0,0 +1,383 @@
1
+ Metadata-Version: 2.4
2
+ Name: robot_obo_tool
3
+ Version: 0.0.1
4
+ Summary: A wrapper around ROBOT
5
+ Keywords: snekpack,cookiecutter,ontologies,obo,robot,open biomedical ontologies
6
+ Author: Charles Tapley Hoyt
7
+ Author-email: Charles Tapley Hoyt <cthoyt@gmail.com>
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 1 - Planning
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Framework :: Pytest
15
+ Classifier: Framework :: tox
16
+ Classifier: Framework :: Sphinx
17
+ Classifier: Natural Language :: English
18
+ Classifier: Programming Language :: Python
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
24
+ Classifier: Programming Language :: Python :: 3 :: Only
25
+ Classifier: Typing :: Typed
26
+ Requires-Dist: pystow
27
+ Maintainer: Charles Tapley Hoyt
28
+ Maintainer-email: Charles Tapley Hoyt <cthoyt@gmail.com>
29
+ Requires-Python: >=3.10
30
+ Project-URL: Bug Tracker, https://github.com/cthoyt/robot-obo-tool/issues
31
+ Project-URL: Homepage, https://github.com/cthoyt/robot-obo-tool
32
+ Project-URL: Repository, https://github.com/cthoyt/robot-obo-tool.git
33
+ Project-URL: Documentation, https://robot_obo_tool.readthedocs.io
34
+ Project-URL: Funding, https://github.com/sponsors/cthoyt
35
+ Description-Content-Type: text/markdown
36
+
37
+ <!--
38
+ <p align="center">
39
+ <img src="https://github.com/cthoyt/robot-obo-tool/raw/main/docs/source/logo.png" height="150">
40
+ </p>
41
+ -->
42
+
43
+ <h1 align="center">
44
+ ROBOT is an OBO Tool
45
+ </h1>
46
+
47
+ <p align="center">
48
+ <a href="https://github.com/cthoyt/robot-obo-tool/actions/workflows/tests.yml">
49
+ <img alt="Tests" src="https://github.com/cthoyt/robot-obo-tool/actions/workflows/tests.yml/badge.svg" /></a>
50
+ <a href="https://pypi.org/project/robot_obo_tool">
51
+ <img alt="PyPI" src="https://img.shields.io/pypi/v/robot_obo_tool" /></a>
52
+ <a href="https://pypi.org/project/robot_obo_tool">
53
+ <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/robot_obo_tool" /></a>
54
+ <a href="https://github.com/cthoyt/robot-obo-tool/blob/main/LICENSE">
55
+ <img alt="PyPI - License" src="https://img.shields.io/pypi/l/robot_obo_tool" /></a>
56
+ <a href='https://robot_obo_tool.readthedocs.io/en/latest/?badge=latest'>
57
+ <img src='https://readthedocs.org/projects/robot_obo_tool/badge/?version=latest' alt='Documentation Status' /></a>
58
+ <a href="https://codecov.io/gh/cthoyt/robot-obo-tool/branch/main">
59
+ <img src="https://codecov.io/gh/cthoyt/robot-obo-tool/branch/main/graph/badge.svg" alt="Codecov status" /></a>
60
+ <a href="https://github.com/cthoyt/cookiecutter-python-package">
61
+ <img alt="Cookiecutter template from @cthoyt" src="https://img.shields.io/badge/Cookiecutter-snekpack-blue" /></a>
62
+ <a href="https://github.com/astral-sh/ruff">
63
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff" style="max-width:100%;"></a>
64
+ <a href="https://github.com/cthoyt/robot-obo-tool/blob/main/.github/CODE_OF_CONDUCT.md">
65
+ <img src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg" alt="Contributor Covenant"/></a>
66
+ <!-- uncomment if you archive on zenodo
67
+ <a href="https://doi.org/10.5281/zenodo.XXXXXX">
68
+ <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.XXXXXX.svg" alt="DOI"></a>
69
+ -->
70
+ </p>
71
+
72
+ A Python wrapper around [ROBOT](https://robot.obolibrary.org/) that automates
73
+ downloading the Java JAR and wraps calls via the console using `subprocess`.
74
+
75
+ ## 💪 Getting Started
76
+
77
+ The `convert` can be called like in:
78
+
79
+ ```python
80
+ import robot_obo_tool
81
+
82
+ robot_obo_tool.convert(
83
+ "https://raw.githubusercontent.com/pato-ontology/pato/master/pato.owl",
84
+ "pato.obo",
85
+ check=False, # remove pesky errors for incorrect OWL
86
+ )
87
+ ```
88
+
89
+ Other ROBOT commands don't (yet) have a wrapper, but you can directly call ROBOT
90
+ with `call()`:
91
+
92
+ ```python
93
+ import robot_obo_tool
94
+
95
+ robot_obo_tool.call(
96
+ "convert",
97
+ "-I"
98
+ "https://raw.githubusercontent.com/pato-ontology/pato/master/pato.owl",
99
+ "-o",
100
+ "pato.obo",
101
+ "--check=false",
102
+ )
103
+ ```
104
+
105
+ ## 🚀 Installation
106
+
107
+ The most recent release can be installed from
108
+ [PyPI](https://pypi.org/project/robot_obo_tool/) with uv:
109
+
110
+ ```console
111
+ $ uv pip install robot_obo_tool
112
+ ```
113
+
114
+ or with pip:
115
+
116
+ ```console
117
+ $ python3 -m pip install robot_obo_tool
118
+ ```
119
+
120
+ The most recent code and data can be installed directly from GitHub with uv:
121
+
122
+ ```console
123
+ $ uv pip install git+https://github.com/cthoyt/robot-obo-tool.git
124
+ ```
125
+
126
+ or with pip:
127
+
128
+ ```console
129
+ $ python3 -m pip install git+https://github.com/cthoyt/robot-obo-tool.git
130
+ ```
131
+
132
+ ## 👐 Contributing
133
+
134
+ Contributions, whether filing an issue, making a pull request, or forking, are
135
+ appreciated. See
136
+ [CONTRIBUTING.md](https://github.com/cthoyt/robot-obo-tool/blob/master/.github/CONTRIBUTING.md)
137
+ for more information on getting involved.
138
+
139
+ ## 👋 Attribution
140
+
141
+ ### ⚖️ License
142
+
143
+ The code in this package is licensed under the MIT License.
144
+
145
+ <!--
146
+ ### 📖 Citation
147
+
148
+ Citation goes here!
149
+ -->
150
+
151
+ <!--
152
+ ### 🎁 Support
153
+
154
+ This project has been supported by the following organizations (in alphabetical order):
155
+
156
+ - [Biopragmatics Lab](https://biopragmatics.github.io)
157
+
158
+ -->
159
+
160
+ <!--
161
+ ### 💰 Funding
162
+
163
+ This project has been supported by the following grants:
164
+
165
+ | Funding Body | Program | Grant Number |
166
+ |---------------|--------------------------------------------------------------|--------------|
167
+ | Funder | [Grant Name (GRANT-ACRONYM)](https://example.com/grant-link) | ABCXYZ |
168
+ -->
169
+
170
+ ### 🍪 Cookiecutter
171
+
172
+ This package was created with
173
+ [@audreyfeldroy](https://github.com/audreyfeldroy)'s
174
+ [cookiecutter](https://github.com/cookiecutter/cookiecutter) package using
175
+ [@cthoyt](https://github.com/cthoyt)'s
176
+ [cookiecutter-snekpack](https://github.com/cthoyt/cookiecutter-snekpack)
177
+ template.
178
+
179
+ ## 🛠️ For Developers
180
+
181
+ <details>
182
+ <summary>See developer instructions</summary>
183
+
184
+ The final section of the README is for if you want to get involved by making a
185
+ code contribution.
186
+
187
+ ### Development Installation
188
+
189
+ To install in development mode, use the following:
190
+
191
+ ```console
192
+ $ git clone git+https://github.com/cthoyt/robot-obo-tool.git
193
+ $ cd robot-obo-tool
194
+ $ uv pip install -e .
195
+ ```
196
+
197
+ Alternatively, install using pip:
198
+
199
+ ```console
200
+ $ python3 -m pip install -e .
201
+ ```
202
+
203
+ ### Pre-commit
204
+
205
+ You can optionally use [pre-commit](https://pre-commit.com) to automate running
206
+ key code quality checks on each commit. Enable it with:
207
+
208
+ ```console
209
+ $ uvx pre-commit install
210
+ ```
211
+
212
+ Or using `pip`:
213
+
214
+ ```console
215
+ $ pip install pre-commit
216
+ $ pre-commit install
217
+ ```
218
+
219
+ ### 🥼 Testing
220
+
221
+ After cloning the repository and installing `tox` with
222
+ `uv tool install tox --with tox-uv` or `python3 -m pip install tox tox-uv`, the
223
+ unit tests in the `tests/` folder can be run reproducibly with:
224
+
225
+ ```console
226
+ $ tox -e py
227
+ ```
228
+
229
+ Additionally, these tests are automatically re-run with each commit in a
230
+ [GitHub Action](https://github.com/cthoyt/robot-obo-tool/actions?query=workflow%3ATests).
231
+
232
+ ### 📖 Building the Documentation
233
+
234
+ The documentation can be built locally using the following:
235
+
236
+ ```console
237
+ $ git clone git+https://github.com/cthoyt/robot-obo-tool.git
238
+ $ cd robot-obo-tool
239
+ $ tox -e docs
240
+ $ open docs/build/html/index.html
241
+ ```
242
+
243
+ The documentation automatically installs the package as well as the `docs` extra
244
+ specified in the [`pyproject.toml`](pyproject.toml). `sphinx` plugins like
245
+ `texext` can be added there. Additionally, they need to be added to the
246
+ `extensions` list in [`docs/source/conf.py`](docs/source/conf.py).
247
+
248
+ The documentation can be deployed to [ReadTheDocs](https://readthedocs.io) using
249
+ [this guide](https://docs.readthedocs.io/en/stable/intro/import-guide.html). The
250
+ [`.readthedocs.yml`](.readthedocs.yml) YAML file contains all the configuration
251
+ you'll need. You can also set up continuous integration on GitHub to check not
252
+ only that Sphinx can build the documentation in an isolated environment (i.e.,
253
+ with `tox -e docs-test`) but also that
254
+ [ReadTheDocs can build it too](https://docs.readthedocs.io/en/stable/pull-requests.html).
255
+
256
+ </details>
257
+
258
+ ## 🧑‍💻 For Maintainers
259
+
260
+ <details>
261
+ <summary>See maintainer instructions</summary>
262
+
263
+ ### Initial Configuration
264
+
265
+ #### Configuring ReadTheDocs
266
+
267
+ [ReadTheDocs](https://readthedocs.org) is an external documentation hosting
268
+ service that integrates with GitHub's CI/CD. Do the following for each
269
+ repository:
270
+
271
+ 1. Log in to ReadTheDocs with your GitHub account to install the integration at
272
+ https://readthedocs.org/accounts/login/?next=/dashboard/
273
+ 2. Import your project by navigating to https://readthedocs.org/dashboard/import
274
+ then clicking the plus icon next to your repository
275
+ 3. You can rename the repository on the next screen using a more stylized name
276
+ (i.e., with spaces and capital letters)
277
+ 4. Click next, and you're good to go!
278
+
279
+ #### Configuring Archival on Zenodo
280
+
281
+ [Zenodo](https://zenodo.org) is a long-term archival system that assigns a DOI
282
+ to each release of your package. Do the following for each repository:
283
+
284
+ 1. Log in to Zenodo via GitHub with this link:
285
+ https://zenodo.org/oauth/login/github/?next=%2F. This brings you to a page
286
+ that lists all of your organizations and asks you to approve installing the
287
+ Zenodo app on GitHub. Click "grant" next to any organizations you want to
288
+ enable the integration for, then click the big green "approve" button. This
289
+ step only needs to be done once.
290
+ 2. Navigate to https://zenodo.org/account/settings/github/, which lists all of
291
+ your GitHub repositories (both in your username and any organizations you
292
+ enabled). Click the on/off toggle for any relevant repositories. When you
293
+ make a new repository, you'll have to come back to this
294
+
295
+ After these steps, you're ready to go! After you make "release" on GitHub (steps
296
+ for this are below), you can navigate to
297
+ https://zenodo.org/account/settings/github/repository/cthoyt/robot-obo-tool to
298
+ see the DOI for the release and link to the Zenodo record for it.
299
+
300
+ #### Registering with the Python Package Index (PyPI)
301
+
302
+ The [Python Package Index (PyPI)](https://pypi.org) hosts packages so they can
303
+ be easily installed with `pip`, `uv`, and equivalent tools.
304
+
305
+ 1. Register for an account [here](https://pypi.org/account/register)
306
+ 2. Navigate to https://pypi.org/manage/account and make sure you have verified
307
+ your email address. A verification email might not have been sent by default,
308
+ so you might have to click the "options" dropdown next to your address to get
309
+ to the "re-send verification email" button
310
+ 3. 2-Factor authentication is required for PyPI since the end of 2023 (see this
311
+ [blog post from PyPI](https://blog.pypi.org/posts/2023-05-25-securing-pypi-with-2fa/)).
312
+ This means you have to first issue account recovery codes, then set up
313
+ 2-factor authentication
314
+ 4. Issue an API token from https://pypi.org/manage/account/token
315
+
316
+ This only needs to be done once per developer.
317
+
318
+ #### Configuring your machine's connection to PyPI
319
+
320
+ This needs to be done once per machine.
321
+
322
+ ```console
323
+ $ uv tool install keyring
324
+ $ keyring set https://upload.pypi.org/legacy/ __token__
325
+ $ keyring set https://test.pypi.org/legacy/ __token__
326
+ ```
327
+
328
+ Note that this deprecates previous workflows using `.pypirc`.
329
+
330
+ ### 📦 Making a Release
331
+
332
+ #### Uploading to PyPI
333
+
334
+ After installing the package in development mode and installing `tox` with
335
+ `uv tool install tox --with tox-uv` or `python3 -m pip install tox tox-uv`, run
336
+ the following from the console:
337
+
338
+ ```console
339
+ $ tox -e finish
340
+ ```
341
+
342
+ This script does the following:
343
+
344
+ 1. Uses [bump-my-version](https://github.com/callowayproject/bump-my-version) to
345
+ switch the version number in the `pyproject.toml`, `CITATION.cff`,
346
+ `src/robot_obo_tool/version.py`, and
347
+ [`docs/source/conf.py`](docs/source/conf.py) to not have the `-dev` suffix
348
+ 2. Packages the code in both a tar archive and a wheel using
349
+ [`uv build`](https://docs.astral.sh/uv/guides/publish/#building-your-package)
350
+ 3. Uploads to PyPI using
351
+ [`uv publish`](https://docs.astral.sh/uv/guides/publish/#publishing-your-package).
352
+ 4. Push to GitHub. You'll need to make a release going with the commit where the
353
+ version was bumped.
354
+ 5. Bump the version to the next patch. If you made big changes and want to bump
355
+ the version by minor, you can use `tox -e bumpversion -- minor` after.
356
+
357
+ #### Releasing on GitHub
358
+
359
+ 1. Navigate to https://github.com/cthoyt/robot-obo-tool/releases/new to draft a
360
+ new release
361
+ 2. Click the "Choose a Tag" dropdown and select the tag corresponding to the
362
+ release you just made
363
+ 3. Click the "Generate Release Notes" button to get a quick outline of recent
364
+ changes. Modify the title and description as you see fit
365
+ 4. Click the big green "Publish Release" button
366
+
367
+ This will trigger Zenodo to assign a DOI to your release as well.
368
+
369
+ ### Updating Package Boilerplate
370
+
371
+ This project uses `cruft` to keep boilerplate (i.e., configuration, contribution
372
+ guidelines, documentation configuration) up-to-date with the upstream
373
+ cookiecutter package. Install cruft with either `uv tool install cruft` or
374
+ `python3 -m pip install cruft` then run:
375
+
376
+ ```console
377
+ $ cruft update
378
+ ```
379
+
380
+ More info on Cruft's update command is available
381
+ [here](https://github.com/cruft/cruft?tab=readme-ov-file#updating-a-project).
382
+
383
+ </details>
@@ -0,0 +1,8 @@
1
+ robot_obo_tool/__init__.py,sha256=XpqQiGi8k0xup5HGPSCUs9--HSmwImUjtxj2fYcecBE,234
2
+ robot_obo_tool/api.py,sha256=iCgmff6T2CO1xX8NpIXDKdF6amNFNBCKhjNIMynAL7c,7096
3
+ robot_obo_tool/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
4
+ robot_obo_tool/version.py,sha256=rOfoDN0tX4ip9CA5soq3II8Nlu7IsKcGCRvjUoEfQm8,981
5
+ robot_obo_tool-0.0.1.dist-info/licenses/LICENSE,sha256=WbIwOsFQp-GusN_pC-xsNP6vQwd-OE46DtHH78XYL1Y,1076
6
+ robot_obo_tool-0.0.1.dist-info/WHEEL,sha256=fAguSjoiATBe7TNBkJwOjyL1Tt4wwiaQGtNtjRPNMQA,80
7
+ robot_obo_tool-0.0.1.dist-info/METADATA,sha256=qas_wVluTWrLds3Gk2Rjgj7WY-sCg4eFyTt2hRlZf7s,13500
8
+ robot_obo_tool-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.9.28
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Charles Tapley Hoyt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.