Skip to content

Commit

Permalink
Merge pull request #58 from nucypher/development
Browse files Browse the repository at this point in the history
TACo Porter 🌮
  • Loading branch information
KPrasch authored Dec 13, 2023
2 parents f185a61 + 391fb36 commit 3bbd473
Show file tree
Hide file tree
Showing 54 changed files with 7,189 additions and 4,588 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.0
current_version = 3.3.0
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(-(?P<stage>[^.]*)\.(?P<devnum>\d+))?
Expand Down
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**Type of PR:**
- [ ] Bugfix
- [ ] Feature
- [ ] Documentation
- [ ] Other

**Required reviews:**
- [ ] 1
- [ ] 2
- [X] 3

**What this does:**
> High-level idea of the changes introduced in this PR.
> List relevant API changes (if any), as well as related PRs and issues.
**Issues fixed/closed:**
> - Fixes #...
**Why it's needed:**
> Explain how this PR fits in the greater context of the NuCypher Network.
> E.g., if this PR addresses a `nucypher/productdev` issue, let reviewers know!
**Notes for reviewers:**
> What should reviewers focus on?
> Is there a particular commit/function/section of your PR that requires more attention from reviewers?
17 changes: 17 additions & 0 deletions .github/workflows/darker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 🧹 Darker

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- uses: akaihola/[email protected]
with:
version: "1.7.2" # defaults to same version, but can be modified
33 changes: 33 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Push Docker Image (version tags)

on:
push:
tags: [ 'v*.*.*' ]

jobs:
docker:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Echo Tag Name
run: echo "Tag - ${{github.ref_name}}"

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ${{ github.workspace }}
file: ./deploy/docker/Dockerfile
push: true
tags: nucypher/porter:${{github.ref_name}}
25 changes: 25 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 🧹 Lint with Ruff

on: [push, pull_request]

jobs:
ruff-lint:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ruff
pip install .
- name: Lint with Ruff
run: ruff --output-format=github porter
33 changes: 24 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,46 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
python -m pip install -r dev-requirements.txt
python scripts/install_solc.py
- id: python_cache
name: Retrieve Cached Python Dependencies
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-pip-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('dev-requirements.txt', 'requirements.txt') }}

- name: Upgrade pip
if: steps.python_cache.outputs.cache-hit != 'true'
run: python -m pip install --upgrade pip

- name: Install dependencies (incl. updated code)
run: pip install .[dev]

- name: Run tests
if: matrix.python-version != '3.9'
run: |
python -m pytest tests
- name: Run tests (Coverage)
if: matrix.python-version == '3.9'
run: |
coverage run --data-file=test_data -m pytest tests
coverage xml -i --data-file=test_data -o coverage.xml
- name: Upload test coverage to Codecov
if: matrix.python-version == '3.8'
if: matrix.python-version == '3.9'
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true
files: coverage.xml
13 changes: 8 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:

- id: tests
name: Run Unit Tests
entry: scripts/run_unit_tests.sh
entry: scripts/run_tests.sh
language: system
types: [python]
stages: [push] # required additional setup: pre-commit install && pre-commit install -t pre-push
Expand Down Expand Up @@ -39,9 +39,12 @@ repos:


- repo: https://github.com/akaihola/darker
rev: 1.4.2
rev: 1.7.2
hooks:
- id: darker
args: [--isort]
additional_dependencies:
- isort~=5.9


- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.4'
hooks:
- id: ruff
13 changes: 6 additions & 7 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ name = "pypi"
python_version = "3"

[packages]
nucypher = {git = "https://github.com/nucypher/nucypher.git", ref = "development"}
nucypher = {git = "https://github.com/nucypher/nucypher.git", ref = "v7.0.3"}
nucypher-core = "==0.13.0" # must be the same as nucypher
flask-cors = "*"
prometheus-flask-exporter = "*"

[dev-packages]
nucypher = {git = "https://github.com/nucypher/nucypher.git", editable = true, ref = "development", extras = ["dev"]} # needed for testerchain, and must be editable
pytest = "*"
nucypher = {git = "https://github.com/nucypher/nucypher.git", editable = true, ref = "v7.0.3", extras = ["dev"]} # needed for testerchain, and must be editable
pytest = "<7" # match with nucypher/nucypher
pytest-cov = "*"
pytest-mock = "*"
# Tools
pre-commit = "2.12.1"
pyflakes = "*"
mypy = "*"
coverage = "<=6.5.0"
py-solc-x = "==0.10.1"

maya = "*"

[pipenv]
allow_prereleases = true
Expand Down
Loading

0 comments on commit 3bbd473

Please sign in to comment.