diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml new file mode 100644 index 00000000..3ac7de1a --- /dev/null +++ b/.github/workflows/build_wheel.yml @@ -0,0 +1,73 @@ +# Build Python sdist and wheel. +name: build_wheels +on: + pull_request: + push: + release: + types: [published] + # Allow trigger via API + workflow_dispatch: +permissions: read-all +jobs: + build_sdist: + name: Build sdist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Install build dependencies + run: | + sudo apt update + sudo apt -y install python3-build + - name: Build sdist + run: | + python -m build --sdist + - uses: actions/upload-artifact@v7 + with: + name: cibw-sdist + path: dist/*.tar.gz + build_wheel: + name: Build wheel + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Install build dependencies + run: | + sudo apt update + sudo apt -y install python3-build python3-wheel + - name: Build wheel + run: | + python -m build --wheel + - uses: actions/upload-artifact@v7 + with: + name: cibw-wheels + path: dist/*.whl + upload_test_pypi: + needs: [build_sdist, build_wheel] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v8 + with: + pattern: cibw-* + path: dist + merge-multiple: true + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + upload_pypi: + needs: [upload_test_pypi] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v8 + with: + pattern: cibw-* + path: dist + merge-multiple: true + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/appveyor.yml b/appveyor.yml index 17d85752..07a70c00 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,27 +14,11 @@ environment: PYTHON_VERSION: "3.14" L2TBINARIES_TRACK: "dev" TARGET: tests - - DESCRIPTION: "Build wheel on Windows with 32-bit Python 3.14" - MACHINE_TYPE: "amd64" - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - PYTHON: "C:\\Python314-x64" - PYTHON_VERSION: "3.14" - L2TBINARIES_TRACK: "dev" - TARGET: wheel - - DESCRIPTION: "Build wheel on Windows with 64-bit Python 3.14" - MACHINE_TYPE: "amd64" - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - PYTHON: "C:\\Python314-x64" - PYTHON_VERSION: "3.14" - L2TBINARIES_TRACK: "dev" - TARGET: wheel install: -- cmd: "%PYTHON%\\python.exe -m pip install -U build pip setuptools twine wheel" +- cmd: "%PYTHON%\\python.exe -m pip install -U build pip setuptools wheel" -build_script: -- cmd: IF [%TARGET%]==[wheel] ( - "%PYTHON%\\python.exe" -m build --wheel ) +build: off test_script: - cmd: IF [%TARGET%]==[tests] ( @@ -42,6 +26,3 @@ test_script: IF EXIST "tests\\end-to-end.py" ( set PYTHONPATH=. && "%PYTHON%\\python.exe" "tests\\end-to-end.py" --debug -c "config\\end-to-end.ini" ) ) - -artifacts: -- path: dist\*.whl diff --git a/l2tdevtools.ini b/l2tdevtools.ini deleted file mode 100644 index 0d8b3a93..00000000 --- a/l2tdevtools.ini +++ /dev/null @@ -1,9 +0,0 @@ -[project] -name: l2tdevtools -status: alpha -name_description: log2timeline development tools -maintainer: Log2Timeline maintainers -homepage_url: https://github.com/log2timeline/l2tdevtools -description_short: Development tools for the log2timeline projects -description_long: Development tools for the log2timeline projects. -python2_only: true diff --git a/l2tdevtools/build_helpers/wheel.py b/l2tdevtools/build_helpers/wheel.py index a1472423..8fd19604 100644 --- a/l2tdevtools/build_helpers/wheel.py +++ b/l2tdevtools/build_helpers/wheel.py @@ -191,8 +191,7 @@ def Build(self, source_helper_object): class ConfigureMakeWheelBuildHelper(WheelBuildHelper): """Helper to build Python wheel packages (.whl). - Builds wheel packages for projects that use configure/make as their build - system. + Builds wheel packages for projects that use configure/make as their build system. """ def Build(self, source_helper_object): diff --git a/pyproject.toml b/pyproject.toml index 8e375c53..3ba7d41b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "l2tdevtools" -version = "20260526" +version = "20260527" description = "Development tools for the log2timeline projects" maintainers = [ { name = "Log2Timeline maintainers", email = "log2timeline-maintainers@googlegroups.com" }, @@ -33,5 +33,17 @@ force-exclude = """ ) """ +[tool.docformatter] +black = true +non-cap = ["str:"] +non-strict = true + +[tool.l2tdevtools] +name = "log2timeline development tools" +status = "alpha" +description = """ +Development tools for the log2timeline projects. \ +""" + [tool.setuptools] package-dir = {"l2tdevtools" = "l2tdevtools"} diff --git a/tests/dependency_writers/appveyor_yml.py b/tests/dependency_writers/appveyor_yml.py index 39c3e677..c2430dfc 100644 --- a/tests/dependency_writers/appveyor_yml.py +++ b/tests/dependency_writers/appveyor_yml.py @@ -14,7 +14,6 @@ class AppveyorYMLTest(test_lib.BaseTestCase): def testInitialize(self): """Tests that the writer can be initialized.""" - l2tdevtools_path = "/fake/l2tdevtools/" project_definition = project.ProjectHelper(l2tdevtools_path) dependencies_file = self._GetTestFilePath(["dependencies.ini"]) diff --git a/tests/dependency_writers/dependencies_py.py b/tests/dependency_writers/dependencies_py.py index 85c5b460..ebcd336f 100644 --- a/tests/dependency_writers/dependencies_py.py +++ b/tests/dependency_writers/dependencies_py.py @@ -14,7 +14,6 @@ class DependenciesPyWriterTest(test_lib.BaseTestCase): def testInitialize(self): """Tests that the writer can be initialized.""" - l2tdevtools_path = "/fake/l2tdevtools/" project_definition = project.ProjectHelper(l2tdevtools_path) dependencies_file = self._GetTestFilePath(["dependencies.ini"]) diff --git a/tests/dependency_writers/dpkg.py b/tests/dependency_writers/dpkg.py index dc20bfb2..d08f0cb2 100644 --- a/tests/dependency_writers/dpkg.py +++ b/tests/dependency_writers/dpkg.py @@ -15,7 +15,6 @@ class DPKGCompatWriterTest(test_lib.BaseTestCase): def testInitialize(self): """Tests that the writer can be initialized.""" - l2tdevtools_path = "/fake/l2tdevtools/" project_definition = project.ProjectHelper(l2tdevtools_path) dependencies_file = self._GetTestFilePath(["dependencies.ini"]) @@ -38,7 +37,6 @@ class DPKGControlWriterTest(test_lib.BaseTestCase): def testInitialize(self): """Tests that the writer can be initialized.""" - l2tdevtools_path = "/fake/l2tdevtools/" project_definition = project.ProjectHelper(l2tdevtools_path) dependencies_file = self._GetTestFilePath(["dependencies.ini"]) diff --git a/tools/stats.py b/tools/stats.py index 423e4f6d..91bfc2ec 100755 --- a/tools/stats.py +++ b/tools/stats.py @@ -277,6 +277,7 @@ def _WritePullRequests(self, project_name, pulls_json, output_writer): pulls_json (list[object]): JSON formatted pull objects. output_writer (OutputWriter): output writer. """ + # https://developer.github.com/v3/pulls/#list-pull-requests # [{ # "created_at": creation date and time of the CL.