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 black and mypy #2146

Merged
merged 7 commits into from
Jun 13, 2024
Merged

fix black and mypy #2146

merged 7 commits into from
Jun 13, 2024

Conversation

mr-tz
Copy link
Collaborator

@mr-tz mr-tz commented Jun 12, 2024

closes #2145

WIP

Checklist

  • No CHANGELOG update needed
  • No new tests needed
  • No documentation update needed

@mr-tz
Copy link
Collaborator Author

mr-tz commented Jun 12, 2024

only need to fix deptry:

scripts/capa2sarif.py:37:5: DEP001 'sarif_om' imported but missing from the dependency definitions
scripts/capa2sarif.py:46:5: DEP001 'jschema_to_python' imported but missing from the dependency definitions
Found 2 dependency issues.

@s-ff how do you recommend to handle these, add these to exclusions or elsewhere?

@fariss
Copy link
Collaborator

fariss commented Jun 12, 2024

only need to fix deptry:

scripts/capa2sarif.py:37:5: DEP001 'sarif_om' imported but missing from the dependency definitions
scripts/capa2sarif.py:46:5: DEP001 'jschema_to_python' imported but missing from the dependency definitions
Found 2 dependency issues.

@s-ff how do you recommend to handle these, add these to exclusions or elsewhere?

I believe we should not exlcude these, but instead introduce them as part of dev optional dependencies in pyproject.toml.

@williballenthin
Copy link
Collaborator

rather than dev let's introduce a new profile scripts, since this tool is meant to be invoked by end users.

@mr-tz
Copy link
Collaborator Author

mr-tz commented Jun 12, 2024

not sure, I love the new scripts and updated install mechanism...

@fariss
Copy link
Collaborator

fariss commented Jun 12, 2024

This would require a documentation update as well, to inform users who want to use scripts

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add bug fixes, new features, breaking changes and anything else you think is worthwhile mentioning to the master (unreleased) section of CHANGELOG.md. If no CHANGELOG update is needed add the following to the PR description: [x] No CHANGELOG update needed

@williballenthin
Copy link
Collaborator

I agree, I don't want to add more steps for users. But the above profile can help with deptry checks.

The new script has an import guard, such that when a required dependency is not found, it explains to the user what to do. Given that we have so many scripts with different setups, maybe this is a reasonable pattern? Then the scripts profile would only be to satisfy deptry.

@williballenthin
Copy link
Collaborator

I'm definitely open to alternatives and further discussions.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@github-actions github-actions bot dismissed their stale review June 13, 2024 07:16

CHANGELOG updated or no update needed, thanks! 😄

@mr-tz mr-tz merged commit 7d1512a into master Jun 13, 2024
27 checks passed
@mr-tz mr-tz deleted the fix/2145 branch June 13, 2024 09:49
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

Successfully merging this pull request may close these issues.

SARIF script mypy failures
3 participants