Skip to content

Conversation

AlbertDeFusco
Copy link

Here I'm using the Python build package to generate the dynamic version string. For example you're pyproject.toml could look like this

[build-system]
requires = ["setuptools", "setuptools-scm"]

[project]
name = "dynamic-version"
dynamic = ["version"]
requires-python = ">=3.10"
dependencies = [
  "requests"
]

[tool.setuptools_scm]

You could also be using Hatch or Flit

and in your recipe meta.yaml

❯ cat conda.recipe/meta.yaml
{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %}
{% set project = pyproject['project'] %}
{% set name = project['name'] %}

{% set metadata = load_python_build_metadata('..', from_recipe_dir=True) %}
{% set version = metadata['Version'] %}

package:
  name: {{ name|lower }}
  version: {{ version }}

Description

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jan 29, 2024
Copy link

Hi there, thank you for your contribution!

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this pull request to remain open please:

  1. Rebase and verify the changes still work
  2. Leave a comment with the current status

NOTE: If this pull request was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Jan 29, 2025
@beckermr
Copy link
Contributor

This is not stale, just ignored.

@github-actions github-actions bot added stale::recovered [bot] recovered after being marked as stale and removed stale [bot] marked as stale due to inactivity labels Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA stale::recovered [bot] recovered after being marked as stale

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

3 participants