Skip to content

Commit

Permalink
Fixing release
Browse files Browse the repository at this point in the history
  • Loading branch information
bschroeter committed Apr 29, 2023
1 parent 4a5f14b commit d371860
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
run: |
python -m twine check dist/*
pwd
if [ -f dist/axiom-0.0.0.tar.gz ]; then
if [ -f dist/acs-axiom-0.0.0.tar.gz ]; then
echo "INVALID VERSION NUMBER"
exit 1
fi
Expand Down Expand Up @@ -114,10 +114,10 @@ jobs:
run: |
python -m twine check dist/*
pwd
if [ -f dist/axiom-0.0.0.tar.gz ]; then
if [ -f dist/acs-axiom-0.0.0.tar.gz ]; then
echo "INVALID VERSION NUMBER"
exit 1
fi
- name: Publish package distributions to TestPyPI
- name: Publish package distributions to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ __pycache__
**.DS_Store
.eggs
docs/build/
dist
2 changes: 1 addition & 1 deletion axiom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from importlib.metadata import version

# Version handle
__version__ = version('axiom')
__version__ = version('acs-axiom')
21 changes: 5 additions & 16 deletions axiom/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import pkgutil
import pathlib
import axiom.utilities as au


class Config(dict):
Expand Down Expand Up @@ -67,34 +68,22 @@ def load(self, config_name, defaults_only=False):
config_name (str): Configuration name, without file extension.
defaults_only (bool, optional): Load only the defaults. Defaults to False.
"""

default_filepath = os.path.join(au.get_installed_data_root(), f'{config_name}.json')
user_filepath = os.path.join(au.get_user_data_root(), f'{config_name}.json')

# Load any installed defaults, if they exists
try:

defaults = pkgutil.get_data('axiom', f'data/{config_name}.json')

if defaults is None:
defaults = dict()
else:
defaults = json.loads(defaults.decode('utf-8'))

except FileNotFoundError:

defaults = dict()
defaults = json.load(open(default_filepath, 'r'))

# Load only the defaults
if defaults_only:
self.update(defaults)
return

# Load the user configuration over the top
user_filepath = os.path.join(pathlib.Path.home(), f'.axiom/{config_name}.json')

if os.path.isfile(user_filepath):
user = json.load(open(user_filepath, 'r'))
defaults.update(user)

# Update the object dictionary
self.update(defaults)


Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = axiom
author = Ben Schreoter
name = acs-axiom
author = Ben Schroeter
author_email = [email protected]
license = MIT
description = A prototype utility for validating/applying metadata templates for scientific data.
Expand Down

0 comments on commit d371860

Please sign in to comment.