Skip to content

Commit b373244

Browse files
authored
Merge pull request #256 from tngTUDOR/issue-228
Issue 228
2 parents 375bb5b + 7ea1cb0 commit b373244

15 files changed

+450
-220
lines changed

.cruft.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"template": "https://github.com/brightway-lca/cookiecutter-brightwaylib",
3+
"commit": "ed6d9090fe8aebb87cd198be5b1abe84e39db280",
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": "brightway2-io",
11+
"package_name": "bw2io",
12+
"project_short_description": "Tools for importing and export life cycle inventory databases",
13+
"version": "0.9.DEV27",
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+
}
Lines changed: 40 additions & 0 deletions
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]
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

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
# We might want to have a separate workflow for legacy branch, since that one supports
12+
# python >= 3.8
13+
# branches: [main]
14+
paths-ignore: # prevents workflow execution when only these types of files are modified
15+
- "**.md" # wildcards prevent file in any repo dir from trigering workflow
16+
- "**.bib"
17+
- "**.ya?ml" # captures both .yml and .yaml
18+
- "LICENSE"
19+
- ".gitignore"
20+
pull_request:
21+
branches: [main]
22+
types: [opened, reopened] # excludes syncronize to avoid redundant trigger from commits on PRs
23+
paths-ignore:
24+
- "**.md"
25+
- "**.bib"
26+
- "**.ya?ml"
27+
- "LICENSE.txt"
28+
- "README.rst"
29+
- ".gitignore"
30+
workflow_dispatch: # also allow manual trigger, for testing purposes
31+
32+
jobs:
33+
test:
34+
runs-on: ${{ matrix.os }}
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
os: [ubuntu-latest, windows-latest, macos-13, ubuntu-20.04, macos-latest, windows-2019]
39+
py-version: ["3.10", "3.11", "3.12"]
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
# general Python setup
45+
- name: Set up Python ${{ matrix.py-version }}
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: ${{ matrix.py-version }}
49+
50+
- name: Update pip & install testing pkgs
51+
run: |
52+
python -VV
53+
python -m pip install --upgrade pip setuptools wheel
54+
55+
# install testing
56+
- name: Install package and test deps
57+
run: |
58+
pip install .[testing] # install the package and the testing deps
59+
60+
- name: Test with pytest
61+
run: |
62+
# the options are configured in the pyproject.toml file
63+
pytest
64+
65+
#- name: Upload coverage reports to Codecov
66+
# uses: codecov/codecov-action@v4

.gitignore

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ parts/
2020
sdist/
2121
var/
2222
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
2325
*.egg-info/
2426
.installed.cfg
2527
*.egg
@@ -38,12 +40,14 @@ pip-delete-this-directory.txt
3840
# Unit test / coverage reports
3941
htmlcov/
4042
.tox/
43+
.nox/
4144
.coverage
4245
.coverage.*
4346
.cache
4447
nosetests.xml
4548
coverage.xml
4649
*.cover
50+
*.py,cover
4751
.hypothesis/
4852
.pytest_cache/
4953

@@ -55,6 +59,7 @@ coverage.xml
5559
*.log
5660
local_settings.py
5761
db.sqlite3
62+
db.sqlite3-journal
5863

5964
# Flask stuff:
6065
instance/
@@ -72,11 +77,26 @@ target/
7277
# Jupyter Notebook
7378
.ipynb_checkpoints
7479

80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
7584
# pyenv
7685
.python-version
7786

78-
# celery beat schedule file
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
7998
celerybeat-schedule
99+
celerybeat.pid
80100

81101
# SageMath parsed files
82102
*.sage.py
@@ -102,6 +122,11 @@ venv.bak/
102122

103123
# mypy
104124
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/
105130

106131
**/.DS_Store
107132
.idea/

CODE_OF_CONDUCT.md

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
## Our Pledge
44

55
In the interest of fostering an open and welcoming environment, we as
6-
contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
711

812
## Our Standards
913

10-
Examples of behavior that contributes to creating a positive environment include:
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
1116

1217
* Using welcoming and inclusive language
1318
* Being respectful of differing viewpoints and experiences
@@ -17,31 +22,55 @@ Examples of behavior that contributes to creating a positive environment include
1722

1823
Examples of unacceptable behavior by participants include:
1924

20-
* The use of sexualized language or imagery and unwelcome sexual attention or advances
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
2127
* Trolling, insulting/derogatory comments, and personal or political attacks
2228
* Public or private harassment
23-
* Publishing others' private information, such as a physical or electronic address, without explicit permission
24-
* Other conduct which could reasonably be considered inappropriate in a professional setting
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
2533

2634
## Our Responsibilities
2735

28-
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
2939

30-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
3145

3246
## Scope
3347

34-
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
3554

3655
## Enforcement
3756

38-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at cmutel@gmail.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at cmutel@gmail.com. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
3963

40-
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
4167

4268
## Attribution
4369

44-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
4572

46-
[homepage]: http://contributor-covenant.org
47-
[version]: http://contributor-covenant.org/version/1/4/
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

0 commit comments

Comments
 (0)