-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from brightway-lca/mapped_m_list
Add `MappedMatrixDict` to enable `MultiLCA` in `bw2calc`
- Loading branch information
Showing
18 changed files
with
771 additions
and
431 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,40 @@ | ||
--- | ||
# Inspired from: | ||
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | ||
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
|
||
on: | ||
push: | ||
branches: [main, develop] | ||
jobs: | ||
build-n-publish: | ||
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Install pypa/build | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: >- | ||
python -m | ||
build | ||
--outdir dist/ | ||
. | ||
- name: Publish distribution 📦 to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository_url: https://test.pypi.org/legacy/ | ||
skip_existing: true | ||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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,62 @@ | ||
--- | ||
# This workflow will install Python dependencies and run tests | ||
# across operating systems, select versions of Python, and user + dev environments | ||
# For more info see: | ||
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Python 🐍 CI/CD tests | ||
|
||
on: | ||
push: | ||
branches: [main, develop] | ||
paths-ignore: # prevents workflow execution when only these types of files are modified | ||
- "**.md" # wildcards prevent file in any repo dir from trigering workflow | ||
- "**.bib" | ||
- "**.ya?ml" # captures both .yml and .yaml | ||
- "LICENSE" | ||
- ".gitignore" | ||
pull_request: | ||
branches: [main, develop] | ||
types: [opened, reopened] # excludes syncronize to avoid redundant trigger from commits on PRs | ||
paths-ignore: | ||
- "**.md" | ||
- "**.bib" | ||
- "**.ya?ml" | ||
- "LICENSE" | ||
- ".gitignore" | ||
workflow_dispatch: # also allow manual trigger, for testing purposes | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
py-version: ["3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# general Python setup | ||
- name: Set up Python ${{ matrix.py-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.py-version }} | ||
|
||
- name: Update pip & install testing pkgs | ||
run: | | ||
python -VV | ||
python -m pip install --upgrade pip setuptools wheel | ||
# install testing | ||
- name: Install package and test deps | ||
run: | | ||
pip install .[testing] # install the package and the testing deps | ||
- name: Test with pytest | ||
run: | | ||
pytest | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 |
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 |
---|---|---|
@@ -1,17 +1,53 @@ | ||
exclude: '^docs/conf.py' | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/psf/black | ||
rev: 19.3b0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.9.3 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
args: ["--profile", "black", "--filter-files"] | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.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, | ||
# ] | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.11.5 | ||
hooks: | ||
- id: isort | ||
args: [--settings-path=pyproject.toml] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.10.0 | ||
hooks: | ||
- id: black | ||
args: [--config=pyproject.toml] | ||
|
||
# - repo: https://github.com/adamchainz/blacken-docs | ||
# rev: 1.16.0 | ||
# hooks: | ||
# - id: blacken-docs | ||
# additional_dependencies: [black] | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [Flake8-pyproject] |
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,21 @@ | ||
--- | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
build: | ||
os: ubuntu-20.04 | ||
tools: | ||
python: "3.10" | ||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
formats: all | ||
python: | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- docs |
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
Oops, something went wrong.