Skip to content

Commit

Permalink
Merge pull request #1 from thetacom/3-implement-entropy-functionality
Browse files Browse the repository at this point in the history
3 implement entropy functionality
  • Loading branch information
thetacom committed Apr 14, 2023
2 parents c3d582d + d469793 commit 86d83a4
Show file tree
Hide file tree
Showing 54 changed files with 1,845 additions and 219 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build

on:
release:
types: [published]

permissions:
contents: read

jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- uses: Gr1N/setup-poetry@v8
- run: poetry --version
- name: Build package
run: poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
101 changes: 33 additions & 68 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,85 +2,50 @@ name: Lint

on: [push]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
bandit:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install bandit
- name: Check files
run: |
mkdir reports
bandit -r -v -f xml -o reports/bandit.xml hexabyte
black:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install black
- name: Check files
run: |
black --check .
mypy:
runs-on: ubuntu-latest
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install mypy
- name: Check files
run: |
mypy --pretty --disable-error-code import hexabyte
pylint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
architecture: x64
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install pylint
- name: Check files
run: |
pylint .
ruff:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true
- name: Load cached venv
id: cached-dependencies
uses: actions/cache@v3
with:
python-version: ${{ matrix.python-version }}
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- run: poetry --version
- name: Install dependencies
run: pip install ruff
- name: Check files
if: steps.cached-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction
- name: Run test suite
run: |
ruff check --config pyproject.toml --show-source -e .
source $VENV
make lint
34 changes: 34 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Pre-Release

on:
create:
push:
tags:
- v*pre

permissions:
contents: write
discussions: write

jobs:
release:
name: Create Package Pre-Release
if: ${{ github.event.type == 'prereleased'}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- uses: Gr1N/setup-poetry@v8
- run: poetry --version
- name: Build package
run: poetry build
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: true
files: |
dist/*
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish

on:
release:
types: [published]

permissions:
contents: read

jobs:
pypi-publish:
name: Upload release to PyPI
if: ${{ github.event.type == 'released'}}
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- uses: Gr1N/setup-poetry@v8
- run: poetry --version
- name: Build package
run: poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
26 changes: 14 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
name: Release

on:
release:
types: [published]
create:
push:
tags:
- v*

permissions:
contents: read
contents: write
discussions: write

jobs:
pypi-publish:
name: Upload release to PyPI
release:
name: Create Package Release
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand All @@ -23,9 +24,10 @@ jobs:
- run: poetry --version
- name: Build package
run: poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Release
uses: softprops/action-gh-release@v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
draft: true
prerelease: false
files: |
dist/*
31 changes: 31 additions & 0 deletions .github/workflows/test-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test Publish

on:
release:
types: [published]

permissions:
contents: read

jobs:
test-pypi-publish:
name: Upload release to Test-PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- uses: Gr1N/setup-poetry@v8
- run: poetry --version
- name: Build package
run: poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
30 changes: 27 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,50 @@ on:
pull_request:
branches: [ "dev", "main" ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: Gr1N/setup-poetry@v8
architecture: x64
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true
- name: Load cached venv
id: cached-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- run: poetry --version
- name: Install external packages
run: sudo apt-get install -y libmagic1
- name: Install dependencies
run: poetry install
if: steps.cached-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Run test suite
run: |
source $VENV
make test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,6 @@ dmypy.json

# Ruff Linter cache
.ruff_cache

# IDE Artifacts
.vscode
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ repos:
rev: v6.1.2
hooks:
- id: rstcheck
args: [--report-level=warning]
args: [--report-level=warning, --ignore-directives, automodule]
files: ^(docs/(.*/)*.*\.rst)
additional_dependencies: [Sphinx==5.0.1]
additional_dependencies: [sphinx==6.1.3]
Loading

0 comments on commit 86d83a4

Please sign in to comment.