diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d5e3d5..a7e9166 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,6 @@ on: push: branches: - master - - libicu-test pull_request: schedule: # run CI every day even if no PRs/merges occur @@ -91,10 +90,11 @@ jobs: matrix: platform: ["ubuntu-latest", "macos-latest"] python: - - "3.8" - - "3.9" - "3.10" - "3.11" + - "3.12" + - "3.13" + - "3.14" runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v6 @@ -132,7 +132,7 @@ jobs: build-arch: ["x64", "Win32"] build-type: ["Debug", "Release"] build-shared: ["0", "1"] - runs-on: windows-2019 + runs-on: windows-2022 steps: - uses: actions/checkout@v6 with: @@ -149,7 +149,7 @@ jobs: mkdir build cd build cmake ` - -G "Visual Studio 16 2019" ` + -G "Visual Studio 17 2022" ` -A ${{ matrix.build-arch }} ` -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} ` -DPEPARSE_ENABLE_TESTING=ON ` @@ -173,10 +173,11 @@ jobs: strategy: matrix: python: - - "3.8" - - "3.9" - "3.10" - "3.11" + - "3.12" + - "3.13" + - "3.14" runs-on: windows-latest steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 937e2af..1ac88ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,9 @@ jobs: python-version: "3.x" - name: sdist - run: python3 setup.py sdist + run: | + python -m pip install build + python -m build --sdist - name: publish uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/README.md b/README.md index 872eb09..3928b09 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ cmake --build . --target install ### Windows-specific -VS 2017 and VS 2019 are supported. +VS 2017, VS 2019, and VS 2022 are supported. ``` # Compile 64-bit binaries with Visual Studio 2017 @@ -97,6 +97,9 @@ cmake -G "Visual Studio 15 2017 Win64" .. # Or, with VS 2019, use the -A flag for architecture cmake -G "Visual Studio 16 2019" -A Win64 .. +# Or, with VS 2022 +cmake -G "Visual Studio 17 2022" -A Win64 .. + # Pass the build type at build time cmake --build . --config Release ``` diff --git a/pepy/README.md b/pepy/README.md index 8549550..4cae5c9 100644 --- a/pepy/README.md +++ b/pepy/README.md @@ -2,7 +2,7 @@ pepy (pronounced p-pie) is a python binding to the pe-parse parser. -pepy supports Python versions 3.6 and above. +pepy supports Python versions 3.10 and above. The easiest way to use pepy is to install it via pip: @@ -16,9 +16,9 @@ If you can build pe-parse and have a working python environment (headers and libraries) you can build pepy. 1. Build pepy: - * `python3 setup.py build` + * `pip install build && python3 -m build` 2. Install pepy: - * `python3 setup.py install` + * `pip install .` **Building on Windows:** Python 3.x is typically installed as _python.exe_, **NOT** _python3.exe_. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..398dabb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "pepy" +dynamic = ["version", "readme"] +description = "Python bindings for pe-parse" +authors = [ + {name = "Wesley Shields", email = "wxs@atarininja.org"} +] +license = "BSD-2-Clause" +requires-python = ">=3.10" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: C++", + "Topic :: Software Development :: Libraries :: Python Modules", +] + +[project.urls] +Homepage = "https://github.com/trailofbits/pe-parse" +Repository = "https://github.com/trailofbits/pe-parse" + +[tool.setuptools] +# pepy is a C extension module, not a Python package +# No Python packages to discover - only the compiled extension from setup.py +packages = [] + +[tool.setuptools.dynamic] +version = {file = "VERSION"} +readme = {file = "pepy/README.md", content-type = "text/markdown"} diff --git a/setup.py b/setup.py index 5a0e1e6..baab162 100644 --- a/setup.py +++ b/setup.py @@ -32,10 +32,6 @@ here = os.path.dirname(__file__) pepy = os.path.join(here, "pepy") - -with open(os.path.join(pepy, "README.md")) as f: - README = f.read() - with open(os.path.join(here, "VERSION")) as f: VERSION = f.read().strip() @@ -95,16 +91,5 @@ libraries=LIBRARIES, ) -setup( - name="pepy", - url="https://github.com/trailofbits/pe-parse", - python_requires=">=3.8", - version=VERSION, - description="Python bindings for pe-parse", - long_description=README, - long_description_content_type="text/markdown", - author="Wesley Shields", - author_email="wxs@atarininja.org", - license="BSD", - ext_modules=[extension_mod], -) +# All metadata now comes from pyproject.toml +setup(ext_modules=[extension_mod])