From adc12acb21a51ef583cb38d7a9fa330e3785a5fa Mon Sep 17 00:00:00 2001 From: Soim Kim Date: Thu, 19 Mar 2026 14:54:42 +0900 Subject: [PATCH 1/2] refactor(build): migrate from setup.py to pyproject.toml --- .bumpversion.cfg | 9 ----- .github/workflows/publish-release.yml | 9 ++--- .reuse/dep5 | 4 -- MANIFEST.in | 1 - pyproject.toml | 56 +++++++++++++++++++++++++++ requirements.txt | 12 ------ setup.py | 40 ------------------- 7 files changed, 60 insertions(+), 71 deletions(-) delete mode 100644 .bumpversion.cfg create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index dcdf008a..00000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[bumpversion] -commit = True -tag = False -message = Bump version: {current_version} → {new_version} -current_version = 2.2.12 - -[bumpversion:file:setup.py] -search = '{current_version}' -replace = '{new_version}' diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 9ce092e2..a72e4e29 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -23,7 +23,6 @@ jobs: env: NEW_TAG: ${{ steps.get_release.outputs.tag_name }} run: | - pip install --upgrade bumpversion LAST_TWO_TAGS=$(git for-each-ref refs/tags/ --count=2 --sort=-v:refname --format="%(refname:short)") LAST_ONE=$(echo $LAST_TWO_TAGS | cut -d' ' -f 2) last_version=$(echo ${LAST_ONE//v/""}) @@ -32,7 +31,7 @@ jobs: echo New version: ${new_version} git config --global user.name "github-actions[bot]" git config --global user.email "fosslight-dev@lge.com" - bumpversion --current-version $last_version --new-version $new_version setup.py + sed -i "s/^version = \".*\"/version = \"$new_version\"/" pyproject.toml - name: update changelog with gren env: GREN_GITHUB_TOKEN: ${{ secrets.TOKEN }} @@ -42,7 +41,7 @@ jobs: - name: Commit files run: | git config --local user.name "github-actions[bot]" - git add CHANGELOG.md + git add CHANGELOG.md pyproject.toml git commit -m "Update ChangeLog" - name: Push changes uses: ad-m/github-push-action@master @@ -64,11 +63,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install build twine - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - python setup.py sdist bdist_wheel + python -m build twine upload dist/* diff --git a/.reuse/dep5 b/.reuse/dep5 index c1762dba..597b3c64 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -22,10 +22,6 @@ Files: requirements*.txt Copyright: 2021 LG Electronics License: Apache-2.0 -Files: .bumpversion.cfg -Copyright: 2021 LG Electronics -License: Apache-2.0 - Files: .coderabbit.yaml Copyright: 2026 LG Electronics License: Apache-2.0 \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 7b741275..c1a7121c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,2 @@ include LICENSE include README.md -include requirements.txt diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..d98362b6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,56 @@ +# Copyright (c) 2026 LG Electronics +# SPDX-License-Identifier: Apache-2.0 + +[build-system] +requires = ["setuptools>=61", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "fosslight_source" +version = "2.2.12" +description = "FOSSLight Source Scanner" +readme = "README.md" +license = { text = "Apache-2.0" } +authors = [ + { name = "LG Electronics" } +] +keywords = ["fosslight", "scanner", "license", "source"] +classifiers = [ + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +requires-python = ">=3.10,<3.13" +dependencies = [ + "setuptools<=80.10.2", + "pyparsing", + "scanoss>=1.19.0", + "XlsxWriter", + "fosslight_util>=2.1.37", + "PyYAML", + "wheel>=0.38.1", + "intbitset", + "fosslight_binary>=5.0.0", + "scancode-toolkit>=32.0.2", + "fingerprints==1.2.3", + "normality==2.6.1", +] + +[project.optional-dependencies] +# none for now + +[project.urls] +Homepage = "https://github.com/fosslight/fosslight_source_scanner" +Download = "https://github.com/fosslight/fosslight_source_scanner" + +[project.scripts] +fosslight_source = "fosslight_source.cli:main" +run_scancode = "fosslight_source.run_scancode:main" + +[tool.setuptools] +package-dir = {"" = "src"} + +[tool.setuptools.packages.find] +where = ["src"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index c463d487..00000000 --- a/requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -setuptools<=80.10.2 -pyparsing -scanoss>=1.19.0 -XlsxWriter -fosslight_util>=2.1.37 -PyYAML -wheel>=0.38.1 -intbitset -fosslight_binary>=5.0.0 -scancode-toolkit>=32.0.2 -fingerprints==1.2.3 -normality==2.6.1 diff --git a/setup.py b/setup.py deleted file mode 100644 index db466ceb..00000000 --- a/setup.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright (c) 2021 LG Electronics -# SPDX-License-Identifier: Apache-2.0 -from codecs import open -from setuptools import setup, find_packages - -with open('README.md', 'r', 'utf-8') as f: - readme = f.read() - -with open('requirements.txt', 'r', 'utf-8') as f: - required = f.read().splitlines() - -if __name__ == "__main__": - setup( - name='fosslight_source', - version='2.2.12', - package_dir={"": "src"}, - packages=find_packages(where='src'), - description='FOSSLight Source Scanner', - long_description=readme, - long_description_content_type='text/markdown', - license='Apache-2.0', - author='LG Electronics', - url='https://github.com/fosslight/fosslight_source_scanner', - download_url='https://github.com/fosslight/fosslight_source_scanner', - classifiers=['License :: OSI Approved :: Apache Software License', - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", ], - python_requires=">=3.10, <3.13", - install_requires=required, - entry_points={ - "console_scripts": [ - "fosslight_source = fosslight_source.cli:main", - "run_scancode = fosslight_source.run_scancode:main" - ] - } - ) From 71dde545fd5cf500aa2cdeeb3cf8ef57763036ab Mon Sep 17 00:00:00 2001 From: Soim Date: Thu, 19 Mar 2026 15:08:35 +0900 Subject: [PATCH 2/2] Update pyproject.toml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d98362b6..8447c7c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,6 @@ Download = "https://github.com/fosslight/fosslight_source_scanner" [project.scripts] fosslight_source = "fosslight_source.cli:main" -run_scancode = "fosslight_source.run_scancode:main" [tool.setuptools] package-dir = {"" = "src"}