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

Fix import issues and dependency installs. #26

Merged
merged 3 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
26 changes: 18 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ pytest-filedata = "^0.4.0"
pytest-cov = "*"
tox = ">=3.20"
tox-gh-actions = "^2.9.1"
toml = "^0.10.2"
tomlkit = "^0.7.2"

# linting
black = ">=20"
Expand Down
5 changes: 3 additions & 2 deletions src/munge/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import collections

import sys
from urllib.parse import urlsplit
from collections.abc import Mapping

import requests

Expand Down Expand Up @@ -48,7 +49,7 @@ def set_type(self, name, typ):
raise NotImplementedError("set_type has not been implemented")

def supports_data(self, data):
if isinstance(data, collections.abc.Mapping):
if isinstance(data, Mapping):
return self.supports_dict
if isinstance(data, list):
return self.supports_list
Expand Down
3 changes: 2 additions & 1 deletion src/munge/codec/toml_toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ def dump(self, data, fobj, **kwargs):
def dumps(self, data):
return toml.dumps(data)

except ImportError:
except ImportError as e:
print(f"failed to import toml module: {e}")
pass
3 changes: 2 additions & 1 deletion src/munge/codec/toml_tomlkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ def dump(self, data, fobj, **kwargs):
def dumps(self, data, **kwargs):
return tomlkit.dumps(data)

except ImportError:
except ImportError as e:
print(f"failed to import tomlkit module: {e}")
pass
8 changes: 5 additions & 3 deletions src/munge/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import collections

import copy
import os
from urllib.parse import urlsplit
from collections.abc import MutableMapping
from collections import namedtuple

import munge
import munge.util
Expand All @@ -10,7 +12,7 @@
# this wouldn't work with tabular data
# need metaclass to allow users to set info once on class
# TODO rename to BaseConfig, set standard setup for Config?
class Config(collections.abc.MutableMapping):
class Config(MutableMapping):
"""
class for storing and manipulating data for config files
"""
Expand Down Expand Up @@ -196,7 +198,7 @@ def find_cls(name, extra_schemes={}):
return munge.get_codec(name)


class MungeURL(collections.namedtuple("MungeURL", "cls url")):
class MungeURL(namedtuple("MungeURL", "cls url")):
pass


Expand Down
Loading