Skip to content

Commit

Permalink
i don't like it but maybe it will work
Browse files Browse the repository at this point in the history
  • Loading branch information
lizgehret committed Aug 2, 2024
1 parent f6950f3 commit 8ecd267
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ci/recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- set pyproject_toml = load_file('..', 'pyproject.toml') | parse_toml %}
{%- set pyproject_toml = load_data('parse_pyproject_toml.py') %}
{%- set version = pyproject_toml.get('project', {}).get('version', 'placehold') %}

package:
Expand All @@ -23,6 +23,7 @@ requirements:
- pip
- setuptools
- wheel
- toml # this is needed to ensure the toml module is available

run:
- python {{ python }}
Expand Down
13 changes: 13 additions & 0 deletions ci/recipe/parse_pyproject_toml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import toml
import os


def parse_toml(file_path):
with open(file_path, 'r') as f:
return toml.load(f)


# This function will be called by conda-build to load the pyproject.toml data
def main():
pyproject_toml_path = os.path.join(os.getcwd(), 'pyproject.toml')
return parse_toml(pyproject_toml_path)

0 comments on commit 8ecd267

Please sign in to comment.