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

Fix add-license-headers for reuse version >=2 #10

Closed
2 tasks done
klmcadams opened this issue Jul 21, 2023 · 0 comments · Fixed by #17
Closed
2 tasks done

Fix add-license-headers for reuse version >=2 #10

klmcadams opened this issue Jul 21, 2023 · 0 comments · Fixed by #17
Assignees
Labels
bug Something isn't working

Comments

@klmcadams
Copy link
Contributor

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

Current usage of lint is not compliant with reuse 2.X, so it's being blocked in the dependencies currently. We should update to reuse 2.x if possible

📝 Steps to reproduce

in pre-commit-hooks repository,

mkdir test-pre-commit-hooks
cd test-pre-commit-hooks
git init
pre-commit sample-config > .pre-commit-config.yaml
git add .pre-commit-config.yaml
git commit -m "add pre-commit configuration"

echo "# test" > test.py
mkdir src
mv test.py src
git add src/test.py
cp -r ../.reuse ./

  • Needed this to locate the ansys.jinja2 file for reuse annotate command
    pre-commit try-repo ../ add-license-headers

in pyproject.toml:
dependencies = [
"importlib-metadata >=4.0",
"reuse",
]

This will show an error:

File "C:\Users\kmcadams\AppData\Local\Temp\tmp55ouq1ke\repoh5j406uu\py_env-python3.11\Lib\site-packages\ansys\pre_commit_hooks\add_license_headers.py", line 60, in get_files
output = lint.lint_files_without_copyright_and_licensing(report, tmp)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'reuse.lint' has no attribute 'lint_files_without_copyright_and_licensing'

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

No response

🐍 Which Python version are you using?

3.11

📦 Installed packages

binaryornot==0.4.4
bleach==6.0.0
boolean.py==4.0
cachetools==5.3.1
certifi==2023.5.7
cfgv==3.3.1
chardet==5.1.0
charset-normalizer==3.2.0
colorama==0.4.6
coverage==7.2.7
distlib==0.3.7
docutils==0.20.1
filelock==3.12.2
flit==3.9.0
flit_core==3.9.0
identify==2.5.25
idna==3.4
importlib-metadata==6.8.0
iniconfig==2.0.0
jaraco.classes==3.3.0
Jinja2==3.1.2
keyring==24.2.0
license-expression==30.1.1
markdown-it-py==3.0.0
MarkupSafe==2.1.3
mdurl==0.1.2
more-itertools==9.1.0
nodeenv==1.8.0
packaging==23.1
pkginfo==1.9.6
platformdirs==3.9.1
pluggy==1.2.0
pre-commit==3.3.3
Pygments==2.15.1
pyproject-api==1.5.3
pytest==7.3.0
pytest-cov==4.0.0
python-debian==0.1.49
pywin32-ctypes==0.2.2
PyYAML==6.0.1
readme-renderer==40.0
requests==2.31.0
requests-toolbelt==1.0.0
reuse==1.1.2
rfc3986==2.0.0
rich==13.4.2
six==1.16.0
tomli_w==1.0.0
tox==4.6.4
twine==4.0.2
urllib3==2.0.4
virtualenv==20.24.1
webencodings==0.5.1
zipp==3.16.2
@klmcadams klmcadams added the bug Something isn't working label Jul 21, 2023
@klmcadams klmcadams self-assigned this Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant