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

Add license check script for incompatible licenses in pip dependencies #16753

Merged
merged 9 commits into from
Jul 1, 2024

Conversation

seanbudd
Copy link
Member

@seanbudd seanbudd commented Jun 27, 2024

Link to issue number:

None

Summary of the issue:

NVDA is licensed with GPL2 which is incompatible with certain licenses like Apache.
Currently there are 2 python dependencies bundled with NVDA with incompatible licenses:

Description of user facing changes

  • Developers can now check licenses with runlicensecheck.bat
  • AppVeyor checks that new dependencies with incompatible licenses aren't introduced

Description of development approach

  • Using the licensecheck pip dependency, check licenses
  • Similar to lint checks, run these checks on appveyor builds

Testing strategy:

Known issues with pull request:

This doesn't check other dependencies such as those in include or miscDeps

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

Summary by CodeRabbit

  • New Features

    • Introduced a license check process to automatically verify compatibility of new Python dependencies.
  • Documentation

    • Updated contributing guidelines to include steps for running the new license check.
    • Expanded automated testing documentation to cover the new license check process.
    • Added build system notes about the new runlicensecheck.bat script.
  • Dependencies

    • Added licensecheck package to requirements.txt.
    • Updated constraints and sources for dependencies like Pillow, wxPython, and configobj.

@seanbudd seanbudd changed the title Add license check script to track incompatible licenses in python dependencies Add license check script for incompatible licenses in pip dependencies Jun 27, 2024
@AppVeyorBot
Copy link

See test results for failed build of commit a842aade39

@seanbudd seanbudd marked this pull request as ready for review June 27, 2024 23:22
@seanbudd seanbudd requested review from a team as code owners June 27, 2024 23:22
Copy link
Contributor

coderabbitai bot commented Jun 27, 2024

Walkthrough

The recent changes focus on enhancing license compliance checks within the project. A new PowerShell and batch script have been added to automate license checks during the build process. The documentation has been updated to reflect these changes, and dependencies have been modified to ensure compatibility with the new license-checking requirements.

Changes

File/Path Summary
appveyor.yml Added a new PowerShell script licenseCheck.ps1 to the test script section.
appveyor/scripts/tests/beforeTests.ps1 Added creation of a new directory testOutput\license.
appveyor/scripts/tests/licenseCheck.ps1 Introduced logic for resolving license output paths, running license checks, and setting build variables.
constraints.txt Specified constraints for the Pillow library to disable certain dependencies.
projectDocs/dev/buildSystemNotes.md Added runlicensecheck.bat to the list of direct execution files.
projectDocs/dev/contributing.md Included a step to run runlicensecheck.bat for checking incompatible licenses in contributing guidelines.
projectDocs/testing/automated.md Documented the use of runlicensecheck.bat for automated license compatibility testing.
pyproject.toml Added configuration for the licensecheck tool to manage license checking processes.
requirements.txt Updated package sources and added new dependencies like licensecheck.
runlicensecheck.bat Batch script to execute license checks for Python dependencies.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant BuildSystem as Build System
    participant LicenseCheck as licenseCheck.ps1
    participant BatchScript as runlicensecheck.bat

    Developer->>BuildSystem: Pushes code to repository
    BuildSystem->>BuildSystem: Triggers build process
    BuildSystem->>LicenseCheck: Executes licenseCheck.ps1 script
    LicenseCheck->>LicenseCheck: Create license output directory
    LicenseCheck->>BatchScript: Calls runlicensecheck.bat
    BatchScript->>LicenseCheck: Sets up environment and runs license check
    LicenseCheck->>BuildSystem: Sets build variables based on check results
    BuildSystem->>Developer: Provides feedback on license check success/failure
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@seanbudd seanbudd requested a review from gerald-hartig June 28, 2024 06:35

### License checks

NVDA uses GPLv2 which is incompatible with certain licenses like Apache.
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it "v2" or "v2 or later"

Copy link
Member Author

@seanbudd seanbudd Jul 1, 2024

Choose a reason for hiding this comment

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

rem Runs a license check for python dependencies
set hereOrig=%~dp0
set here=%hereOrig%
if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1%
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this perhaps clearer in intent?

Suggested change
if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1%
if #%here:~-1%# == #\# set here=%here:~0,-1%

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure, this is magic sauce at the top of each of our .bat files. I'm afraid to change it without updating them all, and concerned this suggestion is different in handling

@seanbudd seanbudd merged commit 62c9122 into master Jul 1, 2024
3 checks passed
@seanbudd seanbudd deleted the addLicenseCheck branch July 1, 2024 02:42
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.

3 participants