Skip to content

Commit

Permalink
Cyclops minor updates (#25)
Browse files Browse the repository at this point in the history
* Fixed error when extra keys are given
* Removed the requirements.txt
* Updated the Github Workflow to use the pipfile
* Added Github Sponsorship link
  • Loading branch information
ohare93 authored May 9, 2021
1 parent 35cf722 commit 7c75fbd
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 132 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: ohare93 # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: jmohare
open_collective: # Replace with a single Open Collective username
ko_fi: brainbrew
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/integrity-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Install dependecies
uses: VaultVulp/action-pipenv@v2.0.1
with:
command: install -d

- name: Run tests
run: py.test

uses: VaultVulp/action-pipenv@v2.0.1
with:
command: run unit_tests

- uses: actions/checkout@v1
- name: Build Yamale Recipe
run: python scripts/yamale_build.py
- name: Check diff
run: git diff --quiet -- || (echo "::error file=yamale,line=0,col=0::You need to run \`python scripts/yamale_build.py\`" && exit 1)
uses: VaultVulp/action-pipenv@v2.0.1
with:
command: run build_yamale

- name: Check Yamale Recipe for changes
run: git diff --quiet -- || (echo "::error file=yamale,line=0,col=0::You need to run 'python scripts/yamale_build.py'" && exit 1)

12 changes: 10 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@ verify_ssl = true
[dev-packages]
pytest = "==5.4.1"
twine = "*"

[packages]
args = "==0.1.0"
clint = "==0.5.1"
coverage = "==4.5.4"
typing-extensions = "==3.10.0.0"

[packages]
"ruamel.yaml" = "==0.16.10"
yamale = "==3.0.4"

[requires]
python_version = "3.7"

[scripts]
build_yamale = "python scripts/yamale_build.py"
check_for_changes = '''
git diff --quiet -- || (echo "::error file=yamale,line=0,col=0::You need to run `python scripts/yamale_build.py`" && exit 1)
'''
unit_tests = "py.test"
165 changes: 90 additions & 75 deletions Pipfile.lock

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

14 changes: 13 additions & 1 deletion brain_brew/configuration/representation_base.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
import inspect
import logging


class RepresentationBase:
@classmethod
def from_dict(cls, data: dict):
return cls(**data) # noqa
expected_values = {
k: v for k, v in data.items()
if k in inspect.signature(cls).parameters
}

if len(expected_values) != len(data):
logging.warning(f"Unexpected values found when creating '{cls.__name__}': "
f"{[k for k, v in data.items() if k not in list(expected_values.keys())]}"
"\n!!! Please report this error if it seems strange")

return cls(**expected_values)

def encode(self):
return {key: value for key, value in self.__dict__.items() if self.encode_filter(key, value)}
Expand Down
2 changes: 1 addition & 1 deletion brain_brew/front_matter.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def latest_version_number():
return "0.3.4"
return "0.3.5"
Loading

0 comments on commit 7c75fbd

Please sign in to comment.