Skip to content

Commit

Permalink
Merge pull request #365 from dyson-ai/feature/update_from_template
Browse files Browse the repository at this point in the history
Feature/update from template
  • Loading branch information
blooop authored May 25, 2024
2 parents 6660d0f + 176803f commit 62d8577
Show file tree
Hide file tree
Showing 12 changed files with 2,554 additions and 58 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@
*.pkl filter=lfs diff=lfs merge=lfs -text
# numpy file format
*.npy filter=lfs diff=lfs merge=lfs -text
# GitHub syntax highlighting
pixi.lock linguist-language=YAML

4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ updates:
#try to group all third party library updates into a single pr
patterns:
- "*"
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
57 changes: 21 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: CI

on:
Expand All @@ -13,38 +10,26 @@ permissions:
contents: read

jobs:

black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
ruff:
runs-on: ubuntu-latest
needs: [black]
steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
build:
ci:
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flit
flit install --extras test
- run: |
pylint $(git ls-files '*.py')
- name: Test with pytest
run: |
coverage run -m pytest
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.22.0
cache: true
- name: Format and lint
run: |
pixi run fmt
pixi run lint
- name: Assert no changes
run: |
git diff --exit-code
- name: Test
run: |
pixi run coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@ cython_debug/
hashed_vars_comparison_tmp
.vscode/active_file.cfg
test/test_bench_server.html
.vscode/active_file.cfg

#COLCON
install/**
log/**
# pixi environments
.pixi
*.egg-info

4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@
"command": "scripts/update_from_template_ours.sh"
},
{
"label": "rename template project name and commit",
"label": "rename template project",
"detail": "Replaces all instances of the template project name with a new name. ",
"type": "shell",
"command": "scripts/rename_project.sh ${input:new_project_name}; git commit -a -m 'rename project'"
"command": "scripts/rename_project.sh ${input:new_project_name}"
},
{
"label": "first time setup of project",
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Changelog

## [0.3.10]

Before changelogs
Before changelogs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ Bencher is designed to work with stochastic pure functions with no side effects.

### Example Output

https://dyson-ai.github.io/bencher/
https://dyson-ai.github.io/bencher/
2 changes: 1 addition & 1 deletion bencher/results/panel_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def to_panes(
target_dimension: int = 0,
container=None,
level: int = None,
**kwargs
**kwargs,
) -> Optional[pn.pane.panel]:
if hv_dataset is None:
hv_dataset = self.to_hv_dataset(ReduceType.SQUEEZE, level=level)
Expand Down
3 changes: 3 additions & 0 deletions deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ apt_tools:
pip_tools:
- flit
- pip #updates to latest pip

pip:
- pip
2,482 changes: 2,482 additions & 0 deletions pixi.lock

Large diffs are not rendered by default.

46 changes: 30 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ description = "A package for benchmarking the performance of arbitrary functions
readme = "README.md"

#incompatible with setuptools
# requires-python = ">= 3.10"

requires-python = "==3.10"

dependencies = [
"holoviews>=1.15,<=1.18.3",
Expand All @@ -30,14 +29,23 @@ dependencies = [
"moviepy>=1.0.3,<=1.0.3",
]

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64"]

[tool.pixi.dependencies]

[tool.pixi.pypi-dependencies]
holobench = { path = ".", editable = true }

[project.optional-dependencies]
test = [
"black>=23,<=24.4.2",
"pylint>=2.16,<=3.1.0",
"pytest-cov>=4.1,<=5.0.0",
"pytest>=7.4,<=8.2.0",
"hypothesis>=6.82,<=6.101.0",
"ruff>=0.0.280,<=0.4.4",
"hypothesis>=6.82,<=6.100.5",
"ruff>=0.0.280,<=0.4.3",
"coverage>=7.2.7,<=7.5.1",
]

Expand All @@ -46,18 +54,26 @@ Repository = "https://github.com/dyson-ai/bencher"
Home = "https://github.com/dyson-ai/bencher"
Documentation = "https://bencher.readthedocs.io/en/latest/"

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.flit.module]
name = "bencher"

# Environments
[tool.pixi.environments]
default = { solve-group = "default" }
test = { features = ["test"], solve-group = "default" }

[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
[tool.pixi.tasks]
pr = "pixi install; git commit -a -m'update pixi.lock';git push"

[tool.pixi.feature.test.tasks]
fmt = "black ."
lint = "ruff check . --fix ; pylint $(git ls-files '*.py')"
test = "pytest"
coverage = "coverage run -m pytest; coverage xml -o coverage.xml"

[tool.setuptools_scm]
# lol just to keep colcon happy
[tool.setuptools.packages.find]
include = ["python_template"]

[tool.pylint]
extension-pkg-whitelist = ["numpy", "scipy"]
Expand All @@ -70,20 +86,18 @@ enable = "no-else-return,consider-using-in"
[tool.black]
line-length = 100


[tool.ruff]
# Never enforce `E501` (line length violations).
#"F841" will auto remove unused variables which is annoying during development, pylint catches this anyway
lint.ignore = ["E501", "E902", "F841"]

ignore = ["E501", "E902", "F841"]

# Same as Black.
line-length = 100

target-version = "py310"

# Allow unused variables when underscore-prefixed.
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
[tool.ruff.lint.per-file-ignores]
Expand Down
2 changes: 1 addition & 1 deletion scripts/launch_vscode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ docker stop "$CONTAINER_NAME" || true

CONTAINER_HEX=$(printf $CONTAINER_NAME | xxd -p | tr '\n' ' ' | sed 's/\\s//g' | tr -d ' ');

rocker --nvidia --x11 --user --pull --git --image-name "$CONTAINER_NAME" --name "$CONTAINER_NAME" --volume "${PWD}":/workspaces/"${CONTAINER_NAME}":Z --oyr-run-arg " --detach" --deps-dependencies ubuntu:22.04
rocker --nvidia --x11 --user --pull --git --image-name "$CONTAINER_NAME" --name "$CONTAINER_NAME" --volume "${PWD}":/workspaces/"${CONTAINER_NAME}":Z --deps --oyr-run-arg " --detach" ubuntu:22.04

# docker pull ghcr.io/red5d/docker-autocompose:latest
# docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/red5d/docker-autocompose $CONTAINER_NAME > .devcontainer/docker-compose.yaml
Expand Down

0 comments on commit 62d8577

Please sign in to comment.