Skip to content

Commit

Permalink
Add pre commit + Cleanup + Python 3.10 (#4)
Browse files Browse the repository at this point in the history
* switch to pyproject.toml

* initial pre-commit

* initial formatting

* formatting

* update configs

* remove spyder docstring

* add pre-commit to reqs

* fix typo

* fixing pre-commit

* add pylint to reqs

* update python 3.9

* fix typo

* fix typo

* fix typo

* remove manifest from gitignore

* set number of jobs for pylint

* python 3.10

* 3.10 to "3.10"

* remove macos-latest, windows-latest

* test commit

* change

* change back

* rerun notebooks

* formatting

* cleanup

* fix data path

* fix data path
  • Loading branch information
msm-sardar authored Jun 4, 2023
1 parent 8146b06 commit 620fe51
Show file tree
Hide file tree
Showing 87 changed files with 1,538 additions and 2,501 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: swolfpy-inputdata
name: PreCommit - swolfpy-inputdata

on:
push:
Expand All @@ -16,21 +16,22 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8]
os: [ubuntu-latest]
python-version: ["3.10"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
- name: Pre-Commit
run: |
py.test
git fetch origin master
pre-commit run --from-ref origin/master --to-ref HEAD --show-diff-on-failure
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ wheels/
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
Expand All @@ -46,6 +45,7 @@ coverage.xml
*.cover
.hypothesis/
.pytest_cache/
test_report.xml

# Translations
*.mo
Expand Down Expand Up @@ -102,4 +102,4 @@ ENV/
.mypy_cache/

# IDE settings
.vscode/
.vscode/
65 changes: 65 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-toml
- id: debug-statements
- id: pretty-format-json
- id: check-merge-conflict

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort


- repo: https://github.com/pycqa/docformatter
rev: v1.5.1
hooks:
- id: docformatter
args: [
--in-place,
--make-summary-multi-line,
--close-quotes-on-newline ,
--pre-summary-newline,
--recursive,
--wrap-summaries=90,
--wrap-descriptions=90,
]

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

- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: python
types: [python]
always_run: true
args: [
swolfpy_inputdata,
tests,
--rcfile=pyproject.toml,
-rn, # Only display messages
-sn, # Don't display the score
]

- id: pytest
name: pytest
entry: pytest
language: python
verbose: true
pass_filenames: false
always_run: true
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Contributors

Acknowledgements
----------------
This work was supported by the National Science Foundation(Awards Numbers: `CBET-1437498`_ and `CBET-1034059`_) and Environmental Research and Educational Foundation (`EREF`_).
This work was supported by the National Science Foundation(Awards Numbers: `CBET-1437498`_ and `CBET-1034059`_) and Environmental Research and Educational Foundation (`EREF`_).

.. _CBET-1437498: https://nsf.gov/awardsearch/showAward?AWD_ID=1437498
.. _CBET-1034059: https://nsf.gov/awardsearch/showAward?AWD_ID=1034059
Expand Down
12 changes: 10 additions & 2 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
History
=======

1.0.0 (2023-06-03)
------------------

* Upgrade to Python 3.10
* Add PreCommit


0.2.4 (2022-04-05)
------------------

* Add Multi-family and commercial Waste collection
* Add Animal feed production (AnF)

Expand All @@ -17,13 +25,13 @@ History
0.2.1 (2021-10-02)
------------------

* New models: Gasification & Syngas combustion (GC), Refuse-Derived Fuel (RDF), Home composting (HC)
* New models: Gasification & Syngas combustion (GC), Refuse-Derived Fuel (RDF), Home composting (HC)


0.1.9 (2021-05-10)
------------------

* Life cycle cost, input data for TS, References
* Life cycle cost, input data for TS, References


0.1.0 (2020-05-06)
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.rst

recursive-include swolfpy_inputdata/data *.csv
recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
Expand Down
Loading

0 comments on commit 620fe51

Please sign in to comment.