Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up python 3.8
- name: Set up python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.11
- name: Run unit tests for minimum dependency generator
run: |
make installdeps
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8
FROM python:3.11

ADD create_feedstock_meta_yaml create_feedstock_meta_yaml
ADD requirements.txt requirements.txt
Expand Down
24 changes: 20 additions & 4 deletions create_feedstock_meta_yaml/create_feedstock_meta_yaml.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import configparser

import os.path
import requests
import tomli
from conda_forge_tick.recipe_parser import CondaMetaYAML
Expand Down Expand Up @@ -58,10 +59,25 @@ def create_feedstock_meta_yaml(
with open(project_metadata_filepath, "rb") as f:
toml_dict = tomli.load(f)

run_requirements = clean_reqs(toml_dict["project"]["dependencies"])
test_requirements = clean_reqs(
toml_dict["project"]["optional-dependencies"]["test"],
)
project = toml_dict["project"]

if 'dynamic' in project:
dynamic = toml_dict["tool"]["setuptools"]["dynamic"]

run_requirements_file = dynamic["dependencies"]["file"][0]
test_requirements_file = dynamic["optional-dependencies"]["test"]["file"][0]

basedir = os.path.dirname(project_metadata_filepath)

with open(os.path.join(basedir, run_requirements_file), "r") as f:
run_requirements = clean_reqs(f.readlines())
with open(os.path.join(basedir, test_requirements_file), "r") as f:
test_requirements = clean_reqs(f.readlines())
elif all(key in project for key in ('dependencies', 'dependencies')):
run_requirements = clean_reqs(toml_dict["project"]["dependencies"])
test_requirements = clean_reqs(
toml_dict["project"]["optional-dependencies"]["test"]
)
else:
raise ValueError(
"Unsupported project metadata file type.",
Expand Down
15 changes: 15 additions & 0 deletions create_feedstock_meta_yaml/test_create_feedstock_meta_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ def test_toml_input(self):
)
verify_cmeta(cmeta, self.pypi_version)

def test_toml_dynamic_input(self):

project_metadata_filepath = os.path.join(self.dir_path, "test_dynamic_pyproject.toml")
meta_yaml_filepath = os.path.join(self.dir_path, "test_meta_toml.yaml")

cmeta = create_feedstock_meta_yaml(
self.project,
self.pypi_version,
project_metadata_filepath=project_metadata_filepath,
meta_yaml_filepath=meta_yaml_filepath,
add_to_run_requirements=self.add_to_run_requirements,
add_to_test_requirements=self.add_to_test_requirements,
)
verify_cmeta(cmeta, self.pypi_version)


def verify_cmeta(cmeta, pypi_version):
expected_run_reqs = [
Expand Down
9 changes: 9 additions & 0 deletions create_feedstock_meta_yaml/test_dynamic_pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[project]
requires-python = ">=3.8,<4"
dynamic = ["dependencies", "optional-dependencies"]

[tool.setuptools.dynamic.dependencies]
file = ["test_dynamic_requirements.txt"]

[tool.setuptools.dynamic.optional-dependencies]
test = { file = ["test_dynamic_requirements_test.txt"] }
11 changes: 11 additions & 0 deletions create_feedstock_meta_yaml/test_dynamic_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
click>=7.0.0
cloudpickle>=1.5.0
dask[dataframe]>=2021.10.0
distributed>=2021.10.0
holidays>=0.13
numpy>=1.21.0
pandas>=1.4.0,!= 1.4.2
psutil>=5.6.6
scipy>=1.3.3
tqdm>=4.32.0
woodwork>=0.16.2
12 changes: 12 additions & 0 deletions create_feedstock_meta_yaml/test_dynamic_requirements_test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
boto3>=1.17.46
composeml>=0.8.0
graphviz>=0.8.4
moto[all]>=3.0.7
pip>=21.3.1
pyarrow>=3.0.0
pympler>=0.8
pytest>=7.1.2
pytest-cov>=3.0.0
pytest-xdist>=2.5.0
smart-open>=5.0.0
urllib3>=1.26.5
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ jinja2
ruamel.yaml
ruamel.yaml.jinja2
packaging
git+https://github.com/regro/cf-scripts.git@master
git+https://github.com/regro/cf-scripts.git@2025.2.91
pre-commit
tomli