Skip to content

Commit

Permalink
wip: revert one change to continue
Browse files Browse the repository at this point in the history
  • Loading branch information
hulkoba committed May 23, 2024
1 parent 8c69272 commit 2334a45
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions conda_smithy/lint_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def lintify_meta_yaml(
lints.append("The recipe license cannot be unknown.")

# 6: Selectors should be in a tidy form.
if recipe_dir is not None and meta_fname.exists():
if recipe_dir is not None and Path(meta_fname).exists():
bad_selectors, bad_lines = [], []
pyXY_selectors_lint, pyXY_lines_lint = [], []
pyXY_selectors_hint, pyXY_lines_hint = [], []
Expand Down Expand Up @@ -348,7 +348,7 @@ def lintify_meta_yaml(
)

# 11: There should be one empty line at the end of the file.
if recipe_dir is not None and meta_fname.exists():
if recipe_dir is not None and Path(meta_fname).exists():
with io.open(meta_fname, "r") as f:
lines = f.read().split("\n")
# Count the number of empty lines from the end of the file
Expand Down Expand Up @@ -463,7 +463,7 @@ def lintify_meta_yaml(
forge_yaml = {}

# 18: noarch doesn't work with selectors for runtime dependencies
if noarch_value is not None and meta_fname.exists():
if noarch_value is not None and Path(meta_fname).exists():
noarch_platforms = len(forge_yaml.get("noarch_platforms", [])) > 1
with io.open(meta_fname, "rt") as fh:
in_runreqs = False
Expand Down Expand Up @@ -507,7 +507,7 @@ def lintify_meta_yaml(
)

# 20: Jinja2 variable definitions should be nice.
if recipe_dir is not None and meta_fname.exists():
if recipe_dir is not None and Path(meta_fname).exists():
bad_jinja = []
bad_lines = []
# Good Jinja2 variable definitions look like "{% set .+ = .+ %}"
Expand Down Expand Up @@ -621,7 +621,7 @@ def lintify_meta_yaml(
)

# 24: jinja2 variable references should be {{<one space>var<one space>}}
if recipe_dir is not None and meta_fname.exists():
if recipe_dir is not None and Path(meta_fname).exists():
bad_vars = []
bad_lines = []
with io.open(meta_fname, "rt") as fh:
Expand Down Expand Up @@ -701,7 +701,7 @@ def check_pins_build_and_requirements(top_level):
# ... so raw meta.yaml and regex it is...
pure_python_wheel_re = re.compile(r".*[:-]\s+(http.*-none-any\.whl)\s+.*")
wheel_re = re.compile(r".*[:-]\s+(http.*\.whl)\s+.*")
if recipe_dir is not None and meta_fname.exists():
if recipe_dir is not None and Path(meta_fname).exists():
with open(meta_fname, "rt") as f:
for line in f:
if match := pure_python_wheel_re.search(line):
Expand Down Expand Up @@ -1155,11 +1155,14 @@ def run_conda_forge_specific(meta, recipe_dir, lints, hints):

# 4: Do not delete example recipe
if is_staged_recipes and recipe_dir is not None:
example_meta_fname = (
Path(recipe_dir).parent / "example" / "meta.yaml"
).absolute()
example_meta_fname = os.path.abspath(
os.path.join(recipe_dir, "..", "example", "meta.yaml")
)
# example_meta_fname = (
# Path(recipe_dir).parent / "example" / "meta.yaml"
# ).absolute()

if not example_meta_fname.exists():
if not Path(example_meta_fname).exists():
msg = (
"Please do not delete the example recipe found in "
"`recipes/example/meta.yaml`."
Expand Down

0 comments on commit 2334a45

Please sign in to comment.