-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4d09e61
Showing
21 changed files
with
577 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
# Allow to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
linter: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.10'] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install project | ||
run: make install | ||
- name: Run linter | ||
run: make lint | ||
|
||
tests_linux: | ||
needs: linter | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.10'] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install project | ||
run: make install | ||
- name: Run tests | ||
run: make test | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
tests_mac: | ||
needs: linter | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.10'] | ||
os: [macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install project | ||
run: make install | ||
- name: Run tests | ||
run: make test | ||
|
||
tests_win: | ||
needs: linter | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.10'] | ||
os: [windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Pip | ||
run: pip install --user --upgrade pip | ||
- name: Install project | ||
run: pip install -e .[test] | ||
- name: run tests | ||
run: pytest -s -vvvv -l --tb=long tests |
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,139 @@ | ||
# analysis output | ||
out/ | ||
|
||
# traces | ||
traces/**/* | ||
sample_traces/**/* | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# templates | ||
.github/templates/* |
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,8 @@ | ||
{ | ||
"python.testing.pytestArgs": [ | ||
"tests" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
"python.analysis.include": ["tests", "tod_attack_miner"] | ||
} |
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 @@ | ||
# How to develop on this project | ||
|
||
This project requires Python3. | ||
|
||
This instructions are for linux base systems. (Linux, MacOS, BSD, etc.) | ||
|
||
## Setting up your own virtual environment | ||
|
||
Run `make virtualenv` to create a virtual environment. | ||
then activate it with `source .venv/bin/activate`. | ||
|
||
## Install the project in develop mode | ||
|
||
Run `make install` to install the project in develop mode. | ||
|
||
## Run the tests to ensure everything is working | ||
|
||
Run `make test` to run the tests. | ||
|
||
## Format the code | ||
|
||
Run `make fmt` to format the code. | ||
|
||
## Run the linter | ||
|
||
Run `make lint` to run the linter. | ||
|
||
## Test your changes | ||
|
||
Run `make test` to run the tests. | ||
|
||
Ensure code coverage report shows `100%` coverage, add tests to your PR. | ||
|
||
## Build the docs locally | ||
|
||
Run `make docs` to build the docs. | ||
|
||
Ensure your new changes are documented. | ||
|
||
## Commit your changes | ||
|
||
This project uses [conventional git commit messages](https://www.conventionalcommits.org/en/v1.0.0/). | ||
|
||
Example: `fix(package): update setup.py arguments 🎉` (emojis are fine too) | ||
|
||
## Makefile utilities | ||
|
||
This project comes with a `Makefile` that contains a number of useful utility. | ||
|
||
```bash | ||
❯ make | ||
Usage: make <target> | ||
|
||
Targets: | ||
help: ## Show the help. | ||
install: ## Install the project in dev mode. | ||
fmt: ## Format code using black & isort. | ||
lint: ## Run pep8, black, mypy linters. | ||
test: lint ## Run tests and generate coverage report. | ||
watch: ## Run tests on every change. | ||
clean: ## Clean unused files. | ||
virtualenv: ## Create a virtual environment. | ||
release: ## Create a new tag for release. | ||
docs: ## Build the documentation. | ||
switch-to-poetry: ## Switch to poetry package manager. | ||
init: ## Initialize the project based on an application template. | ||
``` | ||
|
||
## Making a new release | ||
|
||
This project uses [semantic versioning](https://semver.org/) and tags releases with `X.Y.Z` | ||
Every time a new tag is created and pushed to the remote repo, github actions will | ||
automatically create a new release on github and trigger a release on PyPI. | ||
|
||
For this to work you need to setup a secret called `PIPY_API_TOKEN` on the project settings>secrets, | ||
this token can be generated on [pypi.org](https://pypi.org/account/). | ||
|
||
To trigger a new release all you need to do is. | ||
|
||
1. If you have changes to add to the repo | ||
* Make your changes following the steps described above. | ||
* Commit your changes following the [conventional git commit messages](https://www.conventionalcommits.org/en/v1.0.0/). | ||
2. Run the tests to ensure everything is working. | ||
4. Run `make release` to create a new tag and push it to the remote repo. | ||
|
||
the `make release` will ask you the version number to create the tag, ex: type `0.1.1` when you are asked. | ||
|
||
> **CAUTION**: The make release will change local changelog files and commit all the unstaged changes you have. |
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,5 @@ | ||
FROM python:3.10-slim | ||
COPY . /app | ||
WORKDIR /app | ||
RUN pip install . | ||
CMD ["tod_attack_miner"] |
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,5 @@ | ||
include LICENSE | ||
include HISTORY.md | ||
include Containerfile | ||
graft tests | ||
graft tod_attack_miner |
Oops, something went wrong.