Skip to content

Commit

Permalink
MAINT: adds support for pyproject.toml setup files (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
lizgehret authored Aug 21, 2024
1 parent f2ae05a commit cc4e4ed
Showing 1 changed file with 8 additions and 4 deletions.
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

0 comments on commit cc4e4ed

Please sign in to comment.