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

MAINT: adds support for pyproject.toml setup files #30

Merged
merged 1 commit into from
Aug 21, 2024
Merged
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
12 changes: 8 additions & 4 deletions q2lint/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def validate_project(install_requires):
else:
errors.append('Missing LICENSE file')

for filepath in pathlib.Path('.').glob('**/*.py'):
for filepath in (pathlib.Path('.').glob('**/*.py')
and pathlib.Path('.').glob('**/*.toml')):
if str(filepath).startswith('build/'):
continue
if filepath.name in ('_version.py', 'versioneer.py'):
Expand Down Expand Up @@ -131,9 +132,12 @@ def validate_project(install_requires):
errors.append("Package dependencies should be stored in a "
"conda recipe instead of setup.py "
"`install_requires`.")
if ("license='BSD-3-Clause'" not in text and
'license="BSD-3-Clause"' not in text):
errors.append("Missing BSD-3-Clause license in setup.py")
elif filepath.name == 'pyproject.toml':
filehandle.seek(0)
text = filehandle.read()
if ("license = {file = 'LICENSE'}" not in text):
errors.append(
"Missing BSD-3-Clause license in pyproject.toml")

npm_packages = filter(lambda x: 'node_modules' not in str(x),
pathlib.Path('.').glob('**/*/package.json'))
Expand Down
Loading