Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Tests #51

Merged
merged 11 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
- "**.ya?ml" # captures both .yml and .yaml
- "LICENSE"
- ".gitignore"
- "**.ipynb" # ignore Jupyter notebooks

pull_request:
branches: [main, dev]
types: [opened, reopened] # excludes syncronize to avoid redundant trigger from commits on PRs
Expand All @@ -24,6 +26,7 @@ on:
- "**.ya?ml"
- "LICENSE"
- ".gitignore"
- "**.ipynb" # ignore Jupyter notebooks
workflow_dispatch: # also allow manual trigger, for testing purposes

jobs:
Expand All @@ -32,6 +35,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest] # , windows-latest, macos-latest
py-version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
py-version: ["3.10"]

Expand All @@ -47,7 +52,7 @@ jobs:

# Create the conda environment
- name: Create conda environment
run: conda env create -f timex-environment.yaml
run: conda create -n timex -c conda-forge -c cmutel brightway25 bw_temporalis matplotlib seaborn

# Install testing dependencies from pyproject.toml
- name: Install testing dependencies
Expand Down
75 changes: 75 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
exclude: '^docs/conf.py'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: mixed-line-ending
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows

## If you want to avoid flake8 errors due to unused vars or imports:
# - repo: https://github.com/myint/autoflake
# rev: v1.4
# hooks:
# - id: autoflake
# args: [
# --in-place,
# --remove-all-unused-imports,
# --remove-unused-variables,
# ]

# https://github.com/PyCQA/flake8/issues/234
- repo: https://github.com/john-hen/Flake8-pyproject
rev: 1.2.3
hooks:
- id: Flake8-pyproject

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: [--settings-path=pyproject.toml]

- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
args: [--config=pyproject.toml]

## If like to embrace black styles even in the docs:
# - repo: https://github.com/asottile/blacken-docs
# rev: v1.12.0
# hooks:
# - id: blacken-docs
# additional_dependencies: [black]

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: [Flake8-pyproject]
# You can add flake8 plugins via `additional_dependencies`:
# additional_dependencies: [flake8-bugbear]

- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args:
[
"-rn", # Only display messages
"-sn", # Don't display the score
]
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .fixtures.vehicle_db_fixture import vehicle_db
Loading