-
Notifications
You must be signed in to change notification settings - Fork 13
package the chb API for PyPI as codehawk-binary #296
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
Open
leftbyte
wants to merge
2
commits into
static-analysis-engineering:master
Choose a base branch
from
leftbyte:dphung/pypi-packaging
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| name: release | ||
|
|
||
| # Builds the distribution on every pull request so packaging problems surface in | ||
| # review, and publishes to PyPI when a version tag is pushed. | ||
| on: | ||
| pull_request: | ||
| workflow_dispatch: | ||
| inputs: | ||
| publish_to_testpypi: | ||
| description: "Also publish the built distribution to TestPyPI" | ||
| type: boolean | ||
| default: false | ||
| push: | ||
| tags: ["v*"] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Install build tooling | ||
| run: python -m pip install --upgrade build twine | ||
| - name: Build sdist and wheel | ||
| run: python -m build | ||
| - name: Check metadata | ||
| run: twine check dist/* | ||
| - name: Show what is in the wheel | ||
| run: python -m zipfile -l dist/*.whl | ||
| - uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
|
|
||
| # Dry run, on demand: same artifact, TestPyPI instead of PyPI. TestPyPI keeps | ||
| # every version it has seen, so a repeat run needs a bumped chbversion. | ||
| publish-testpypi: | ||
| if: github.event_name == 'workflow_dispatch' && inputs.publish_to_testpypi | ||
| needs: build | ||
| runs-on: ubuntu-22.04 | ||
| environment: testpypi | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
| - uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| repository-url: https://test.pypi.org/legacy/ | ||
|
|
||
| publish: | ||
| # Tags only. Trusted publishing, so no API token is stored in the repository. | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| needs: build | ||
| runs-on: ubuntu-22.04 | ||
| environment: pypi | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
| - uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| [build-system] | ||
| requires = ["setuptools>=77"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "codehawk-binary" | ||
| description = "Python API for the CodeHawk Binary Analyzer" | ||
| readme = "README.md" | ||
| license = "MIT" | ||
| license-files = ["LICENSE"] | ||
| requires-python = ">=3.9" | ||
| authors = [{ name = "Aarno Labs LLC", email = "codehawk@aarno-labs.com" }] | ||
| keywords = ["binary analysis", "reverse engineering", "static analysis", "abstract interpretation"] | ||
| classifiers = [ | ||
| "Development Status :: 4 - Beta", | ||
| "Intended Audience :: Developers", | ||
| "Intended Audience :: Science/Research", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3 :: Only", | ||
| "Topic :: Security", | ||
| "Topic :: Software Development :: Disassemblers", | ||
| "Typing :: Typed", | ||
| ] | ||
| # The package imports nothing outside the standard library. | ||
| dependencies = [] | ||
| dynamic = ["version"] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://github.com/static-analysis-engineering/CodeHawk-Binary" | ||
| Source = "https://github.com/static-analysis-engineering/CodeHawk-Binary" | ||
| Issues = "https://github.com/static-analysis-engineering/CodeHawk-Binary/issues" | ||
|
|
||
| [tool.setuptools.dynamic] | ||
| version = { attr = "chb.app.CHVersion.chbversion" } | ||
|
|
||
| # Include only the chb package in the distribution. Without this filter, package | ||
| # discovery also picks up doc/ and tests/ and installs them as importable | ||
| # top-level names in every environment that installs this package. | ||
| [tool.setuptools.packages.find] | ||
| include = ["chb*"] | ||
|
|
||
| # ConfigLocal.py is gitignored local configuration that exists in most working | ||
| # copies. It is a .py file inside the package, so discovery would otherwise bake | ||
| # a developer's absolute analyzer paths into the distribution. | ||
| [tool.setuptools.exclude-package-data] | ||
| "chb.util" = ["ConfigLocal.py"] | ||
|
|
||
| # Config() opens each of these by path inside the installed package, so they must | ||
| # be included in the wheel. A wheel holding only .py files imports fine and then | ||
| # fails at runtime with FileNotFoundError under site-packages. | ||
| [tool.setuptools.package-data] | ||
| "chb" = ["py.typed"] | ||
| "chb.summaries" = ["bchsummaries.jar", "bch_header.c"] | ||
| "chb.util" = ["localetable.json", "ConfigLocal.template"] | ||
| "chb.arm.opcodes" = ["opcodes_covered.json"] | ||
| "chb.pwr.opcodes" = ["opcodes_covered.json"] | ||
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
README.md says 3.5?
https://github.com/leftbyte/CodeHawk-Binary/blob/master/README.md#requirements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated README to 3.9. The runtime floor is 3.9, set by three PEP 585 builtin generics in chb/cmdline/reportcmds.py: