Skip to content

Commit

Permalink
Update cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Dec 19, 2024
1 parent 13e4ca1 commit a687b5a
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 41 deletions.
3 changes: 2 additions & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"template": "https://github.com/cthoyt/cookiecutter-snekpack",
"commit": "1884310d930f56787c96d4eba45bcb4a5225f7cb",
"commit": "0491ce7066df95aec19ca2ff5740207804ac1840",
"checkout": null,
"context": {
"cookiecutter": {
"package_name": "curies",
"package_name_stylized": "CURIEs",
"short_description": "Idiomatic conversion between URIs and compact URIs (CURIEs)",
"author_name": "Charles Tapley Hoyt",
"author_github": "cthoyt",
"author_email": "[email protected]",
"github_organization_name": "biopragmatics",
"github_repository_name": "curies",
Expand Down
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository
github:
- cthoyt
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--
Thanks for contributing to `curies`.
To help us out with reviewing, please consider the following:
- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
Caution: the maintainers often take an active role in pull requests,
and may push to your branch. Therefore, you should always sync your
local copy of the repository with the remote before continuing your
work.
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
matrix:
python-version: [ "3.12", "3.9" ]
tox-command: ["manifest", "lint", "pyroma", "mypy"]
tox-command: ["lint", "pyroma", "mypy"]
steps:
- uses: actions/checkout@v4
- name: "Install uv"
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,16 @@ The final section of the README is for if you want to get involved by making a c
To install in development mode, use the following:

```console
git clone git+https://github.com/biopragmatics/curies.git
cd curies
python3 -m pip install -e .
$ git clone git+https://github.com/biopragmatics/curies.git
$ cd curies
$ uv --preview pip install -e .
```

Alternatively, install using legacy pip with `UV_PREVIEW` mode enabled
until the uv build backend becomes a stable feature:

```console
$ UV_PREVIEW=1 python3 -m pip install -e .
```

### Updating Package Boilerplate
Expand Down Expand Up @@ -231,7 +238,7 @@ You only have to do the following steps once.

#### Configuring your machine's connection to PyPI

You have to do the following steps once per machine.
You have to do the following steps once per machine.

```console
$ uv tool install keyring
Expand Down
34 changes: 12 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# See https://setuptools.readthedocs.io/en/latest/build_meta.html
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["uv>=0.5.10,<0.6.0"]
# The uv backend entered preview mode in https://github.com/astral-sh/uv/pull/8886/files
# with the 0.5.0 release. See also https://github.com/astral-sh/uv/issues/3957 for tracking.
build-backend = "uv"

[project]
name = "curies"
Expand Down Expand Up @@ -47,10 +48,11 @@ keywords = [
"URIs",
]

# License Information. This can be any valid SPDX identifiers that can be resolved
# with URLs like https://spdx.org/licenses/MIT
# See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license
license = { file = "LICENSE" }
# License Information.
# See PEP-639 at https://peps.python.org/pep-0639/#add-license-files-key
license-files = [
"LICENSE",
]

requires-python = ">=3.9"
dependencies = [
Expand All @@ -63,7 +65,7 @@ dependencies = [
[project.optional-dependencies]
tests = [
"pytest",
"coverage",
"coverage[toml]",
"requests",
]
pandas = [
Expand All @@ -90,29 +92,17 @@ docs = [
]

# See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#urls
# and also https://packaging.python.org/en/latest/specifications/well-known-project-urls/
[project.urls]
"Bug Tracker" = "https://github.com/biopragmatics/curies/issues"
Homepage = "https://github.com/biopragmatics/curies"
Repository = "https://github.com/biopragmatics/curies.git"
Documentation = "https://curies.readthedocs.io"

[tool.setuptools]
package-dir = { "" = "src" }
license-files = []

[tool.setuptools.packages.find]
# this implicitly sets `packages = ":find"`
where = ["src"] # list of folders that contain the packages (["."] by default)

# See https://setuptools.pypa.io/en/latest/userguide/datafiles.html
[tool.setuptools.package-data]
"*" = ["*.*"]

Funding = "https://github.com/sponsors/cthoyt"

[project.scripts]
curies = "curies.cli:main"


[tool.cruft]
skip = [
"**/__init__.py",
Expand Down
38 changes: 25 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ envlist =
format
# format-docs
# Code quality assessment
manifest
pyroma
lint
mypy
Expand All @@ -28,7 +27,12 @@ envlist =
py
doctests
# always keep coverage-report last
# coverage-report
coverage-report

[testenv:.pkg]
# this special environment configures the build that tox does itself
set_env =
UV_PREVIEW=1

[testenv]
description = Run unit and integration tests.
Expand All @@ -45,6 +49,10 @@ extras =
flask
fastapi
rdflib
set_env =
# this setting gets inherited into all environments, meaning
# that things that call uv commands don't require a --preview
UV_PREVIEW=1

[testenv:coverage-clean]
description = Remove testing coverage artifacts.
Expand Down Expand Up @@ -89,12 +97,6 @@ skip_install = true
commands =
rstfmt docs/source/

[testenv:manifest]
deps = check-manifest
skip_install = true
commands = check-manifest
description = Check that the MANIFEST.in is written properly and give feedback on how to fix it.

[testenv:lint]
description = Check code quality using ruff and other tools.

Expand Down Expand Up @@ -174,11 +176,9 @@ allowlist_externals =
mkdir

[testenv:coverage-report]
# TODO this is broken
deps = coverage
deps = coverage[toml]
skip_install = true
commands =
coverage combine
coverage report

####################
Expand All @@ -205,7 +205,6 @@ deps =
skip_install = true
deps =
uv
setuptools
commands =
uv build --sdist --wheel --no-build-isolation

Expand All @@ -225,7 +224,7 @@ commands =
# 7. Add your token to keyring with `keyring set https://upload.pypi.org/legacy/ __token__`

[testenv:release]
description = Release the code to PyPI so users can pip install it
description = Release the code to PyPI so users can pip install it, using credentials from keyring
skip_install = true
deps =
{[testenv:build]deps}
Expand All @@ -235,6 +234,19 @@ commands =
{[testenv:build]commands}
uv publish --username __token__ --keyring-provider subprocess --publish-url https://upload.pypi.org/legacy/

[testenv:release-via-env]
description = Release the code to PyPI so users can pip install it, using credentials from the environment.
skip_install = true
deps =
{[testenv:build]deps}
uv
commands =
{[testenv:build]commands}
uv publish --publish-url https://upload.pypi.org/legacy/
passenv =
UV_PUBLISH_USERNAME
UV_PUBLISH_PASSWORD

[testenv:finish]
description =
Run a workflow that removes -dev from the version, creates a tagged release on GitHub,
Expand Down

0 comments on commit a687b5a

Please sign in to comment.