Skip to content

Commit e36f76e

Browse files
authored
Switch to Poetry (#104)
* Switch to Poetry, and update test data with some rounded values to try and help comparisons * Fix github actions yml error
1 parent c837190 commit e36f76e

File tree

90 files changed

+75952
-76719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+75952
-76719
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/ci.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,29 +41,33 @@ jobs:
4141
with:
4242
python-version: 3.7
4343

44-
- name: Upgrade pip
45-
run: |
46-
python -m pip install --upgrade pip
47-
echo "PIP_CACHE_DIR=$(python -m pip cache dir)" >> $GITHUB_ENV
44+
- name: Install Poetry
45+
uses: snok/[email protected]
4846

49-
- name: Cache python dependencies
50-
uses: actions/cache@v2
51-
id: cache-python
47+
- name: Cache Poetry virtualenv
48+
uses: actions/cache@v1
49+
id: cache
5250
with:
53-
path: ${{ env.PIP_CACHE_DIR }}
54-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/requirements.txt', 'requirements/requirements-dev.txt') }}
51+
path: ~/.virtualenvs
52+
key: poetry-${{ hashFiles('**/poetry.lock') }}
53+
restore-keys: |
54+
poetry-${{ hashFiles('**/poetry.lock') }}
55+
56+
- name: Set Poetry config
57+
run: |
58+
poetry config virtualenvs.in-project false
59+
poetry config virtualenvs.path ~/.virtualenvs
5560
56-
- name: Install Dependencies (uses the cache when requirements did not change)
61+
- name: Install Dependencies
5762
run: |
58-
python -m pip install -r requirements/requirements.txt
59-
python -m pip install -r requirements/requirements-dev.txt
60-
python -m pip install --upgrade twine wheel
63+
poetry install
64+
if: steps.cache.outputs.cache-hit != 'true'
6165

6266
- name: Code Quality
63-
run: python -m black . --check
67+
run: poetry run black . --check
6468

6569
- name: Test with pytest
66-
run: python -m pytest -n 2 --cov . --cov-report=xml --cov-config=.coveragerc
70+
run: poetry run pytest -n 2 --cov . --cov-report=xml
6771

6872
- name: Upload coverage to Codecov
6973
uses: codecov/codecov-action@v1

.readthedocs.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
# .readthedocs.yml
2-
# Read the Docs configuration file
3-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4-
5-
# Required
61
version: 2
72

8-
# Build documentation in the docs/ directory with Sphinx
93
sphinx:
104
configuration: docs/source/conf.py
115

12-
# Optionally build your docs in additional formats such as PDF and ePub
13-
formats: all
14-
15-
# Optionally set the version of Python and requirements required to build your docs
166
python:
177
version: 3.7
188
install:
19-
- requirements: requirements/requirements-rtd.txt
9+
- method: pip
10+
path: .
11+
extra_requirements:
12+
- docs

MANIFEST.in

Lines changed: 0 additions & 17 deletions
This file was deleted.

clarite/__init__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# flake8: noqa
2-
from ._version import get_versions
1+
try:
2+
import importlib.metadata as importlib_metadata
3+
except ModuleNotFoundError:
4+
import importlib_metadata
35

46
from .modules import modify, plot, describe, analyze, load, survey
57

6-
__version__ = get_versions()["version"]
7-
del get_versions
8+
__version__ = importlib_metadata.version(__name__)
9+
10+
__all__ = ["__version__", "modify", "plot", "describe", "analyze", "load", "survey"]

0 commit comments

Comments
 (0)