Skip to content

Commit 90de5be

Browse files
committed
Initial commit
0 parents  commit 90de5be

29 files changed

+1479
-0
lines changed

.cruft.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"template": "https://github.com/brightway-lca/cookiecutter-brightwaylib",
3+
"commit": "2dd8d2464644700b16636f7b3d71972e5bf6e803",
4+
"checkout": null,
5+
"context": {
6+
"cookiecutter": {
7+
"full_name": "Chris Mutel",
8+
"email": "cmutel@gmail.com",
9+
"github_username": "brightway-lca",
10+
"project_name": "ecoinvent_migrate",
11+
"package_name": "ecoinvent_migrate",
12+
"project_short_description": "Code to generate Randonneur migration files for ecoinvent releases",
13+
"version": "0.0.1",
14+
"use_pytest": "y",
15+
"open_source_license": "BSD-3-Clause",
16+
"copyright_year": "2024",
17+
"_copy_without_render": [
18+
".github/*"
19+
],
20+
"_template": "https://github.com/brightway-lca/cookiecutter-brightwaylib"
21+
}
22+
},
23+
"directory": null
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
# Inspired from:
3+
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
4+
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
5+
6+
on:
7+
push:
8+
branches: [main, develop]
9+
jobs:
10+
build-n-publish:
11+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
12+
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Python 3.11
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.11"
21+
- name: Install pypa/build
22+
run: >-
23+
python -m
24+
pip install
25+
build
26+
--user
27+
- name: Build a binary wheel and a source tarball
28+
run: >-
29+
python -m
30+
build
31+
--outdir dist/
32+
.
33+
- name: Publish distribution 📦 to Test PyPI
34+
uses: pypa/gh-action-pypi-publish@release/v1
35+
with:
36+
repository-url: https://test.pypi.org/legacy/
37+
skip-existing: true
38+
- name: Publish distribution 📦 to PyPI
39+
if: startsWith(github.ref, 'refs/tags')
40+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/python-test.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
# This workflow will install Python dependencies and run tests
3+
# across operating systems, select versions of Python, and user + dev environments
4+
# For more info see:
5+
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
6+
7+
name: Python 🐍 CI/CD tests
8+
9+
on:
10+
push:
11+
branches: [main, develop]
12+
paths-ignore: # prevents workflow execution when only these types of files are modified
13+
- "**.md" # wildcards prevent file in any repo dir from trigering workflow
14+
- "**.bib"
15+
- "**.ya?ml" # captures both .yml and .yaml
16+
- "LICENSE"
17+
- ".gitignore"
18+
pull_request:
19+
branches: [main, develop]
20+
types: [opened, reopened] # excludes syncronize to avoid redundant trigger from commits on PRs
21+
paths-ignore:
22+
- "**.md"
23+
- "**.bib"
24+
- "**.ya?ml"
25+
- "LICENSE"
26+
- ".gitignore"
27+
workflow_dispatch: # also allow manual trigger, for testing purposes
28+
29+
jobs:
30+
build:
31+
runs-on: ${{ matrix.os }}
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
os: [ubuntu-latest, windows-latest, macos-13, ubuntu-20.04, macos-latest, windows-2019]
36+
py-version: ["3.9", "3.10", "3.11", "3.12"]
37+
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
# general Python setup
42+
- name: Set up Python ${{ matrix.py-version }}
43+
uses: actions/setup-python@v5
44+
with:
45+
python-version: ${{ matrix.py-version }}
46+
47+
- name: Update pip & install testing pkgs
48+
run: |
49+
python -VV
50+
python -m pip install --upgrade pip setuptools wheel
51+
52+
# install testing
53+
- name: Install package and test deps
54+
run: |
55+
pip install .[testing] # install the package and the testing deps
56+
57+
- name: Test with pytest
58+
run: |
59+
pytest
60+
61+
- name: Upload coverage reports to Codecov
62+
uses: codecov/codecov-action@v4

.gitignore

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/

.pre-commit-config.yaml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
exclude: '^docs/conf.py'
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.5.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: check-added-large-files
9+
- id: check-ast
10+
- id: check-json
11+
- id: check-merge-conflict
12+
- id: check-xml
13+
- id: check-yaml
14+
- id: debug-statements
15+
- id: end-of-file-fixer
16+
- id: requirements-txt-fixer
17+
- id: mixed-line-ending
18+
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows
19+
20+
## If you want to avoid flake8 errors due to unused vars or imports:
21+
# - repo: https://github.com/myint/autoflake
22+
# rev: v1.4
23+
# hooks:
24+
# - id: autoflake
25+
# args: [
26+
# --in-place,
27+
# --remove-all-unused-imports,
28+
# --remove-unused-variables,
29+
# ]
30+
31+
# https://github.com/PyCQA/flake8/issues/234
32+
- repo: https://github.com/john-hen/Flake8-pyproject
33+
rev: 1.2.3
34+
hooks:
35+
- id: Flake8-pyproject
36+
37+
- repo: https://github.com/pycqa/isort
38+
rev: 5.13.2
39+
hooks:
40+
- id: isort
41+
args: [--settings-path=pyproject.toml]
42+
43+
- repo: https://github.com/psf/black
44+
rev: 24.1.1
45+
hooks:
46+
- id: black
47+
args: [--config=pyproject.toml]
48+
49+
## If like to embrace black styles even in the docs:
50+
# - repo: https://github.com/asottile/blacken-docs
51+
# rev: v1.12.0
52+
# hooks:
53+
# - id: blacken-docs
54+
# additional_dependencies: [black]
55+
56+
- repo: https://github.com/PyCQA/flake8
57+
rev: 7.0.0
58+
hooks:
59+
- id: flake8
60+
additional_dependencies: [Flake8-pyproject]
61+
# You can add flake8 plugins via `additional_dependencies`:
62+
# additional_dependencies: [flake8-bugbear]
63+
64+
- repo: local
65+
hooks:
66+
- id: pylint
67+
name: pylint
68+
entry: pylint
69+
language: system
70+
types: [python]
71+
args:
72+
[
73+
"-rn", # Only display messages
74+
"-sn", # Don't display the score
75+
]

.readthedocs.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
conda:
9+
environment: docs/environment.yaml
10+
11+
sphinx:
12+
configuration: docs/conf.py
13+
14+
submodules:
15+
include: all
16+
17+
build:
18+
os: "ubuntu-lts-latest" # https://docs.readthedocs.io/en/stable/config-file/v2.html#build-os
19+
tools:
20+
python: "mambaforge-latest" # https://docs.readthedocs.io/en/stable/config-file/v2.html#build-tools-python, mamba instead of conda for better build performance

CHANGES.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# `ecoinvent_migrate` Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.1.0] - 2022-03-22
11+
12+
### Added
13+
14+
### Changed
15+
16+
### Removed

0 commit comments

Comments
 (0)