Skip to content

Commit

Permalink
chore(conda): make conda use the correct git revision
Browse files Browse the repository at this point in the history
  • Loading branch information
philtweir committed Mar 7, 2024
1 parent 35c95c0 commit 997c33e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/generate_recipe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import textwrap
import os
import toml

with open("pyproject.toml") as f:
Expand All @@ -18,5 +19,6 @@
deps_string += f" - {dep}\n"
TEMPLATE = TEMPLATE.replace("__PROJECT_DEPENDENCIES__", deps_string)
TEMPLATE = TEMPLATE.replace("__README__", readme_string)
TEMPLATE = TEMPLATE.replace("__GIT_REVISION__", os.environ["GITHUB_SHA"])
with open("recipe.yaml", "w") as f:
f.write(TEMPLATE)
3 changes: 2 additions & 1 deletion recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ context:
repository: ${{ load_from_file("pyproject.toml").project.repository }}

package:
name: ${{ load_from_file("pyproject.toml").project.version }}
name: ${{ load_from_file("pyproject.toml").project.name }}
version: ${{ load_from_file("pyproject.toml").project.version }}

source:
- git: ${{ repository }}
rev: __GIT_REVISION__

build:
# Thanks to `noarch: python` this package works on all platforms
Expand Down

0 comments on commit 997c33e

Please sign in to comment.