-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #458 from crytic/dev
prepare for 0.3.2 release
- Loading branch information
Showing
30 changed files
with
735 additions
and
269 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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,46 @@ | ||
name: docs | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: ["master"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
build: | ||
environment: | ||
name: Crytic-Compile Documentation | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
- run: pip install -e ".[doc]" | ||
- run: pdoc -o html/ crytic_compile | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
# Upload the doc | ||
path: './html/' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |
This file contains 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
This file contains 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,55 @@ | ||
name: Publish to PyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-release: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Build distributions | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install build | ||
python -m build | ||
- name: Upload distributions | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: crytic-compile-dists | ||
path: dist/ | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
environment: release | ||
permissions: | ||
id-token: write # For trusted publishing + codesigning. | ||
contents: write # For attaching signing artifacts to the release. | ||
needs: | ||
- build-release | ||
steps: | ||
- name: fetch dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: crytic-compile-dists | ||
path: dist/ | ||
|
||
- name: publish | ||
uses: pypa/[email protected] | ||
|
||
- name: sign | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: ./dist/*.tar.gz ./dist/*.whl | ||
release-signing-artifacts: true | ||
bundle-only: true |
This file contains 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 |
---|---|---|
|
@@ -10,3 +10,5 @@ dist/ | |
node_modules | ||
package-lock.json | ||
result | ||
env/ | ||
.coverage* |
This file contains 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,88 @@ | ||
SHELL := /bin/bash | ||
|
||
PY_MODULE := crytic_compile | ||
TEST_MODULE := tests | ||
|
||
ALL_PY_SRCS := $(shell find $(PY_MODULE) -name '*.py') \ | ||
$(shell find test -name '*.py') | ||
|
||
# Optionally overriden by the user, if they're using a virtual environment manager. | ||
VENV ?= env | ||
|
||
# On Windows, venv scripts/shims are under `Scripts` instead of `bin`. | ||
VENV_BIN := $(VENV)/bin | ||
ifeq ($(OS),Windows_NT) | ||
VENV_BIN := $(VENV)/Scripts | ||
endif | ||
|
||
# Optionally overridden by the user in the `release` target. | ||
BUMP_ARGS := | ||
|
||
# Optionally overridden by the user in the `test` target. | ||
TESTS := | ||
|
||
# Optionally overridden by the user/CI, to limit the installation to a specific | ||
# subset of development dependencies. | ||
CRYTIC_COMPILE_EXTRA := dev | ||
|
||
# If the user selects a specific test pattern to run, set `pytest` to fail fast | ||
# and only run tests that match the pattern. | ||
# Otherwise, run all tests and enable coverage assertions, since we expect | ||
# complete test coverage. | ||
ifneq ($(TESTS),) | ||
TEST_ARGS := -x -k $(TESTS) | ||
COV_ARGS := | ||
else | ||
# TEST_ARGS := -n auto | ||
COV_ARGS := # --fail-under 100 | ||
endif | ||
|
||
.PHONY: all | ||
all: | ||
@echo "Run my targets individually!" | ||
|
||
.PHONY: dev | ||
dev: $(VENV)/pyvenv.cfg | ||
|
||
.PHONY: run | ||
run: $(VENV)/pyvenv.cfg | ||
@. $(VENV_BIN)/activate && crytic-compile $(ARGS) | ||
|
||
$(VENV)/pyvenv.cfg: pyproject.toml | ||
# Create our Python 3 virtual environment | ||
python3 -m venv env | ||
$(VENV_BIN)/python -m pip install --upgrade pip | ||
$(VENV_BIN)/python -m pip install -e .[$(CRYTIC_COMPILE_EXTRA)] | ||
|
||
.PHONY: lint | ||
lint: $(VENV)/pyvenv.cfg | ||
. $(VENV_BIN)/activate && \ | ||
black --check . && \ | ||
pylint $(PY_MODULE) $(TEST_MODULE) && \ | ||
mypy $(PY_MODULE) | ||
# ruff $(ALL_PY_SRCS) | ||
|
||
.PHONY: reformat | ||
reformat: | ||
. $(VENV_BIN)/activate && \ | ||
black . | ||
|
||
.PHONY: test tests | ||
test tests: $(VENV)/pyvenv.cfg | ||
. $(VENV_BIN)/activate && \ | ||
pytest --cov=$(PY_MODULE) $(T) $(TEST_ARGS) && \ | ||
python -m coverage report -m $(COV_ARGS) | ||
|
||
.PHONY: doc | ||
doc: $(VENV)/pyvenv.cfg | ||
. $(VENV_BIN)/activate && \ | ||
pdoc -o html crytic_compile | ||
|
||
.PHONY: package | ||
package: $(VENV)/pyvenv.cfg | ||
. $(VENV_BIN)/activate && \ | ||
python3 -m build | ||
|
||
.PHONY: edit | ||
edit: | ||
$(EDITOR) $(ALL_PY_SRCS) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.