Skip to content

Commit

Permalink
Consolidate metadata in pyproject.toml and reuse in Conda recipe (#42)
Browse files Browse the repository at this point in the history
* Add license metadata and rest of URLs to `pyproject.toml`
* Load these and other metadata in Conda recipe
  • Loading branch information
jakirkham authored Feb 5, 2025
1 parent cc36730 commit 20e30ee
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
34 changes: 25 additions & 9 deletions conda/recipes/rapids-metadata/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@

{% set pyproject_data = load_file_data("pyproject.toml") %}
{% set version = pyproject_data["project"]["version"] %}

# Load `requirements` metadata
{% set python_version = pyproject_data["project"]["requires-python"] %}
{% set requirements_host = pyproject_data["build-system"]["requires"] %}
{% set requirements_run = pyproject_data["project"]["dependencies"] %}

# Load `about` metadata
{% set home = pyproject_data["project"]["urls"]["Homepage"] %}
{% set license = pyproject_data["project"]["license"]["text"] %}
{% set license_files = pyproject_data["tool"]["setuptools"]["license-files"] %}
{% set summary = pyproject_data["project"]["description"] %}
{% set dev_url = pyproject_data["project"]["urls"]["Source"] %}
{% set doc_url = pyproject_data["project"]["urls"]["Documentation"] %}


package:
name: rapids-metadata
Expand All @@ -19,26 +32,29 @@ build:
requirements:
host:
- pip
- python >=3.9
- python {{ python_version }}
- conda-verify
{% for r in pyproject_data["build-system"]["requires"] %}
{% for r in requirements_host %}
- {{ r }}
{% endfor %}
run:
- python >=3.9
{% for r in pyproject_data["project"]["dependencies"] %}
- python {{ python_version }}
{% for r in requirements_run %}
- {{ r }}
{% endfor %}

about:
home: https://rapids.ai/
license: Apache-2.0
license_file: LICENSE
home: {{ home }}
license: {{ license }}
license_file:
{% for e in license_files %}
- ../../../{{ e }}
{% endfor %}
summary: {{ summary }}
dev_url: {{ dev_url }}
doc_url: {{ doc_url }}
description: |
This package contains metadata related to the structure of the RAPIDS
project itself. It contains information about what repositories are present
in the RAPIDS project, what packages are present in each repository, and
the properties of each package.
doc_url: https://docs.rapids.ai/
dev_url: https://github.com/rapidsai/rapids-metadata
12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024, NVIDIA CORPORATION.
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,9 +18,9 @@ version = "0.3.1"
authors = [
{ name = "RAPIDS Development Team", email = "pypi@rapids.ai" }
]
urls = { homepage = "https://github.com/rapidsai/rapids-metadata" }
description = "metadata for structure of RAPIDS projects"
license = { file = "LICENSE" }
readme = "README.md"
license = { text = "Apache-2.0" }
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
Expand All @@ -34,6 +34,11 @@ dependencies = [
[project.scripts]
rapids-metadata-json = "rapids_metadata.json:main"

[project.urls]
Homepage = "https://github.com/rapidsai/rapids-metadata"
Documentation = "https://docs.rapids.ai/"
Source = "https://github.com/rapidsai/rapids-metadata"

[build-system]
build-backend = "setuptools.build_meta"
requires = [
Expand All @@ -48,6 +53,7 @@ test = [
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`.

[tool.setuptools]
license-files = ["LICENSE"]
packages = { "find" = { where = ["src"] } }

[tool.pytest.ini_options]
Expand Down

0 comments on commit 20e30ee

Please sign in to comment.