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

Improve packaging #3459 #3761

Open
wants to merge 29 commits into
base: develop
Choose a base branch
from
Open

Improve packaging #3459 #3761

wants to merge 29 commits into from

Conversation

pombredanne
Copy link
Member

@pombredanne pombredanne commented May 1, 2024

This PR improves packaging of ScanCode by adopting flot as a build tool
With this we have an overall simpler and more explicit build including

  • smaller wheels to fit within PyPI quotas
  • unified and simpler build scripts
  • a new wheel for packagedcode

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

We are now using only a pyproject.toml

Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
We now have tow new packages that will be pubslihed as wheels:
* licensedcode-data that contains only the plain text files for
  licenses and license rules
* licensedcode-index that contains only the pre-built index
  with compressed licenses and license rules baked-in

Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Remove old mumbo jumbo renaming manifests

Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Actually make this works for building with flot.

Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Since we use pip with --no-build-isolation we need to provide
flot before we install anything.

Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
These are now provided by the separate licensecode-data and
licensecode-index packages.

Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
We must install flot first before doing any other installations.
Also cleanup dead code.

Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added 17 commits May 6, 2024 12:36
The plain pyproject.toml is for development only

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
- Remove dependencies that are not direct.

- Start to abstract some of the dependencies on the
  licensedcode module.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Move packagedcode.__init__.py code to handlers.py to allow distributing
multiple smaller packages built with flot.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This is cleaner and makes tracking licenses much easier.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Guard import with "try/except ImportError" towards packaging models
as a standalone wheel

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
* packagedcode-models only contains the models.py
* packagedcode-pypi only contains the pypi code and depends on models.

This way we have small minimal wheel needed to support FetchCode and
python-inspector.

Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
* Use new pyproject TOML fiels for scancode
* Build packagedcode-models and packagedcode-pypi

Reference: #3459
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Guard the usage also when doing plain expression hanlding that rely on
the SPDX license key data from the LicenseIndex/License cache.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@AyanSinhaMahapatra AyanSinhaMahapatra mentioned this pull request Sep 6, 2024
6 tasks
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.

1 participant