diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5fccaf..f0e0996 100755 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,8 +5,8 @@ on: types: [published] jobs: - build_wheels: - name: Build wheel + build_wheel_and_sdist: + name: Build wheel and tar.gz runs-on: ubuntu-latest steps: @@ -15,32 +15,18 @@ jobs: with: python-version: '3.10' - name: Install dependencies - run: pip install wheel - - name: Build wheel - run: pip wheel -w wheels . - - uses: actions/upload-artifact@v3 + run: pip install build + - name: Build wheel and sdist + run: python -m build + - uses: actions/upload-artifact@v4 with: name: artifact - path: ./wheels/python_binexport*.whl - - build_sdist: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Build sdist - run: | - python -m pip install -U pip build - python -m build --sdist - - uses: actions/upload-artifact@v3 - with: - name: artifact - path: dist/*.tar.gz + path: | + ./dist/python_binexport*.whl + ./dist/*.tar.gz upload_pypi: - needs: [build_wheels, build_sdist] + needs: build_wheel_and_sdist runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v3 diff --git a/.gitignore b/.gitignore index f58a61f..724d4f9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ __pycache__/ *$py.class build/ +dist/ *.egg-info/ /venv/ diff --git a/pyproject.toml b/pyproject.toml index 264f976..1bc3137 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,8 @@ version = "0.2.1" description = "Python wrapper to manipulate binexport files (protobuf)" readme = { file = "README.md", content-type = "text/markdown" } authors = [{ name = "Quarkslab", email = "diffing@quarkslab.com" }] +license = {text = "AGPL-3.0"} +requires-python = ">=3.9" dependencies = [ "python-magic", "python-magic-bin; os_name=='nt'", @@ -29,8 +31,8 @@ Repository = "https://github.com/quarkslab/python-binexport" Documentation = "https://quarkslab.github.io/diffing-portal/exporter/binexport.html#python-binexport" "Bug Tracker" = "https://github.com/quarkslab/python-binexport/issues" -[tools.setuptools] -script-files = ["bin/binexporter"] +[project.scripts] +binexporter = 'binexport.__main__:main' [tool.black] line-length = 100 diff --git a/setup.py b/setup.py deleted file mode 100644 index 820c14d..0000000 --- a/setup.py +++ /dev/null @@ -1,38 +0,0 @@ -from setuptools import setup - -with open("README.md") as f: - README = f.read() - - -setup( - name="python-binexport", - version="0.2.1", - description="Python wrapper to manipulate binexport files (protobuf)", - long_description_content_type='text/markdown', - long_description=README, - author="Robin David", - author_email="rdavid@quarkslab.com", - url="https://github.com/quarkslab/python-binexport", - packages=["binexport"], - python_requires=">=3.9", - project_urls={ - "Documentation": "https://quarkslab.github.io/diffing-portal/exporter/binexport.html#python-binexport", - "Bug Tracker": "https://github.com/quarkslab/python-binexport/issues", - "Source": "https://github.com/quarkslab/python-binexport" - }, - install_requires=[ - "python-magic", - "click", - "protobuf", - "networkx", - "enum_tools", - "idascript" - ], - scripts=["bin/binexporter"], - license="AGPL-3.0", - classifiers=[ - 'Topic :: Security', - 'Environment :: Console', - 'Operating System :: OS Independent', - ], -) diff --git a/bin/binexporter b/src/binexport/__main__.py similarity index 100% rename from bin/binexporter rename to src/binexport/__main__.py