Skip to content

Commit

Permalink
Merge pull request #44 from CivicActions/version-bump
Browse files Browse the repository at this point in the history
Version upgrades
  • Loading branch information
Tom-Camp authored Aug 24, 2023
2 parents 777635c + 16e3366 commit a7b8533
Show file tree
Hide file tree
Showing 13 changed files with 1,276 additions and 1,125 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.10'

- name: Install poetry
uses: abatilo/actions-poetry@v2.1.0
with:
poetry-version: 1.1.4
poetry-version: 1.5.1

- name: Install dependencies
run:
Expand Down
8 changes: 8 additions & 0 deletions .idea/.gitignore

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

8 changes: 8 additions & 0 deletions .idea/compliance-io.iml

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

14 changes: 14 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

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

4 changes: 4 additions & 0 deletions .idea/misc.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

2 changes: 2 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mypy-slugify.*]
ignore_missing_imports = True
25 changes: 10 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: ^CHANGELOG\.md$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.4.0
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: reorder-python-imports
language_version: python3
- id: isort
name: isort (python)
args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.3.0
hooks:
- id: black
language_version: python3
- repo: https://gitlab.com/PyCQA/flake8
rev: 3.8.4
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
language_version: python3
- repo: https://github.com/markdownlint/markdownlint
rev: v0.11.0
hooks:
- id: markdownlint
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.800
rev: v0.950
hooks:
- id: mypy
args: [--ignore-missing-imports]
19 changes: 8 additions & 11 deletions complianceio/opencontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@
"""
from enum import Enum
from pathlib import Path
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Set
from typing import Any, Dict, List, Optional, Set

import rtyaml
from blinker import signal
from pydantic import BaseModel
from pydantic import PrivateAttr
from pydantic import BaseModel, PrivateAttr
from slugify import slugify

OPENCONTROL_SCHEMA_VERSION = "1.0.0"
Expand Down Expand Up @@ -196,7 +191,7 @@ def load(cls, path: str, debug=True):
return oc

def save(self):
"Write back an OpenControl repo to where it was loaded"
"""Write back an OpenControl repo to where it was loaded"""
root_dir = self._root_dir
root = self.dict(exclude={"standards", "components", "systems"})
root["certifications"] = [
Expand All @@ -209,7 +204,7 @@ def save(self):
print(rtyaml.dump(root))

def save_as(self, base_dir):
"Save an OpenControl repo in a new location"
"""Save an OpenControl repo in a new location"""
root = self.dict(exclude={"standards", "components", "systems"})
root["certifications"] = []
for cert in self.certifications:
Expand Down Expand Up @@ -267,7 +262,8 @@ class OpenControlYaml(BaseModel):
systems: Optional[List[str]]
dependencies: Optional[Dict[str, List[Dependency]]]

def _component_path(self, component, relative_to):
@staticmethod
def _component_path(component, relative_to):
path = relative_to / component
if path.is_dir():
path = path / "component.yaml"
Expand Down Expand Up @@ -300,7 +296,8 @@ def resolve_components(self, relative_to):
raise Exception(msg)
return resolved_components

def _is_fen(self, obj):
@staticmethod
def _is_fen(obj):
satisfies = obj.get("satisfies", [])
if isinstance(satisfies, list) and len(satisfies) > 0:
return isinstance(satisfies[0], str)
Expand Down
Loading

0 comments on commit a7b8533

Please sign in to comment.