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

Update packaging structure #78

Merged
merged 7 commits into from
Apr 16, 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
42 changes: 25 additions & 17 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,35 @@ jobs:
test:
name: ${{ matrix.python-version }}-build
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4.5.0
- uses: actions/checkout@v4
- name: Install Conda environment from environment.yml
uses: mamba-org/setup-micromamba@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/dev-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: |
python -m pip install -r dev-requirements.txt
python -m pip install --no-deps -e .
python -m pip list
- name: Running Tests
environment-name: carbonplan
condarc: |
channels:
- conda-forge
- nodefaults
cache-downloads: false
cache-environment: true
create-args: >-
python=${{ matrix.python-version }}
- name: Install package
run: |
python -m pip install -e .[dev]
- name: Conda list information
run: |
conda env list
conda list
- name: Run tests
run: |
python -m pytest --junitxml=test-reports/junit.xml --cov=./ --verbose
- name: Upload coverage to Codecov
Expand Down
137 changes: 137 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
processed/
.DS_Store

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
carbonplan_data/_version.py

# 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
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# web
.next
node_modules
2 changes: 0 additions & 2 deletions .isort.cfg

This file was deleted.

49 changes: 34 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,54 @@
ci:
autoupdate_schedule: quarterly

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-json
- id: check-yaml
- id: double-quote-string-fixer
- id: debug-statements
- id: mixed-line-ending

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args:
- "--py38-plus"

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.3.0
hooks:
- id: black
args: ["--line-length", "100", "--skip-string-normalization"]
- id: black-jupyter

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
- repo: https://github.com/keewis/blackdoc
rev: v0.3.9
hooks:
- id: flake8
- repo: https://github.com/asottile/seed-isort-config
rev: v2.2.0
- id: blackdoc

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.5"
hooks:
- id: seed-isort-config
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
- id: ruff
args: ["--fix"]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: isort
- id: prettier

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
language_version: system
name: prettier-markdown
entry: prettier --write --parser mdx
files: "\\.(\
|md|markdown|mdown|mkdn\
|mdx\
)$"
2 changes: 1 addition & 1 deletion carbonplan_styles/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
try:
version = get_distribution(__name__).version
except DistributionNotFound: # pragma: no cover
version = '0.0.0' # pragma: no cover
version = "0.0.0" # pragma: no cover
__version__ = version


Expand Down
Loading
Loading