Skip to content

Commit

Permalink
use tomli
Browse files Browse the repository at this point in the history
  • Loading branch information
abearab committed Jul 23, 2024
1 parent 84aa0fc commit e60cacb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Source = "https://github.com/abearab/scez"
# "pytest"
# ]

[tool.poetry.group.test.dependencies]
pytest = "*"
tomli = "*"

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"
7 changes: 5 additions & 2 deletions scez/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
from . import utils
import scanpy as sc
import matplotlib.pyplot as plt
import importlib.metadata as metadata

__version__ = metadata.version(__name__)
import tolmi

toml_dict = tomli.load(open('pyproject.toml','rb'))
__version__ = toml_dict['tool']['poetry']['version']


sc.settings.verbosity = 1 # verbosity: errors (0), warnings (1), info (2), hints (3)
sc.settings.set_figure_params(dpi=100, dpi_save=300, frameon=False, figsize=(5, 5), facecolor='white')
Expand Down
6 changes: 4 additions & 2 deletions scez/tests/test_scez.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
import matplotlib.pyplot as plt
import scanpy as sc
import scez
from scez import __version__
import tomli

toml_dict = tomli.load(open('pyproject.toml','rb'))
version = toml_dict['tool']['poetry']['version']

class TestScezConfig(unittest.TestCase):
def test_version(self):
self.assertEqual(scez.__version__, __version__)
self.assertEqual(scez.__version__, version)

def test_scanpy_settings(self):
self.assertEqual(sc.settings.verbosity, 1)
Expand Down

0 comments on commit e60cacb

Please # to comment.