Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linter warning about python version selectors in arch-specific recipes #904

Open
jasongrout opened this issue Oct 8, 2018 · 2 comments
Open

Comments

@jasongrout
Copy link
Contributor

jasongrout commented Oct 8, 2018

We recently had an issue fixed in jupyterlab-feedstock where we used python version selectors with an arch-specific recipe (i.e., not noarch). This causes problems.

It would be great if the linter warned against using python version selectors in this case, and pointed people to using the skip recipe lines, similar to how the linter warns against using skip in noarch recipes at

# 17: noarch doesn't work with selectors
if build_section.get('noarch') is not None and os.path.exists(meta_fname):
with io.open(meta_fname, 'rt') as fh:
in_requirements = False
for line in fh:
line_s = line.strip()
if (line_s == "requirements:"):
in_requirements = True
requirements_spacing = line[:-len(line.lstrip())]
continue
if line_s.startswith("skip:") and is_selector_line(line):
lints.append("`noarch` packages can't have selectors. If "
"the selectors are necessary, please remove "
"`noarch: {}`.".format(build_section['noarch']))
break
if in_requirements:
if requirements_spacing == line[:-len(line.lstrip())]:
in_requirements = False
continue
if is_selector_line(line):
lints.append("`noarch` packages can't have selectors. If "
"the selectors are necessary, please remove "
"`noarch: {}`.".format(build_section['noarch']))
break

@jasongrout
Copy link
Contributor Author

Somewhat related to #528, #257

@djsutherland
Copy link
Contributor

Probably a good thing to add a lint about, but it could be valid if you have python as a build dependency but not host, e.g. a C library that uses a Python build script but doesn't install any Python stuff. Just something to think about in adding the check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants