Skip to content

Commit 3f4f784

Browse files
authored
Chores (#17)
* Fix Publish Workflow Path * Update Gitignore and Settings * Update Draft Workflow Name * Update Tests * Black formatting
1 parent 03c745e commit 3f4f784

File tree

7 files changed

+102
-205
lines changed

7 files changed

+102
-205
lines changed

cppython/exceptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Custom exceptions used by CPPython
33
"""
44

5+
56
class ConfigError(Exception):
67
def __init__(self, error: Exception) -> None:
78
self._error = error
@@ -10,4 +11,4 @@ def __init__(self, error: Exception) -> None:
1011

1112
@property
1213
def error(self) -> Exception:
13-
return self._error
14+
return self._error

cppython/schema.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ class Metadata(BaseModel):
2828
Data required by the tool
2929
"""
3030

31-
from cppython.plugins.generator.cmake import CMakeGenerator
32-
33-
generator: str = CMakeGenerator.name()
31+
# TODO: Grab default from plugin without circular import
32+
generator: str = "CMake"
3433
target: TargetEnum
3534
dependencies: dict[str, str] = []
3635
install_path: Path = Field(alias="install-path")
@@ -134,4 +133,4 @@ def data_type(self):
134133
"""
135134
Returns the pydantic type to cast the generator configuration data to
136135
"""
137-
raise NotImplementedError()
136+
raise NotImplementedError()

pdm.lock

Lines changed: 89 additions & 156 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test = [
3636
"pytest~=6.2",
3737
"pytest-cov~=3.0",
3838
"pytest-mock~=3.6",
39-
"pytest-xdist~=2.4",
39+
"pytest-xdist~=2.5",
4040
]
4141

4242
[project.scripts]

tests/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import pytest
22

33
from pathlib import Path
4-
from distutils.dir_util import copy_tree
4+
from shutil import copytree
55

66

77
@pytest.fixture
88
def tmp_workspace(tmp_path):
9-
'''
9+
"""
1010
Load the dummy project to its initial state
11-
'''
11+
"""
1212

1313
template_directory = Path("tests/data/test_project").absolute()
1414
directory = Path(tmp_path).absolute()
15-
copy_tree(str(template_directory), str(directory))
15+
copytree(str(directory), str(template_directory), dirs_exist_ok=True)
1616

1717
return directory

tests/unit/test_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class TestCLIInterface(BaseInterface):
1616
def test_command(self, interface, command, mocker):
1717

1818
# Patch the project
19-
mocker.patch('cppython.plugins.interface.console.Config.load')
19+
mocker.patch("cppython.plugins.interface.console.Config.load")
2020

2121
# Patch the file IO
22-
mocker.patch('cppython.plugins.interface.console._read_data')
22+
mocker.patch("cppython.plugins.interface.console._read_data")
2323

2424
config = Config()
2525

tests/unit/test_plugin.py

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1 @@
1-
from synodic_poetry.plugin import SynodicPlugin
2-
from conans.client.conan_api import ConanAPIV1
3-
4-
5-
class TestFormat:
6-
def test_validation(self, tmp_workspace):
7-
with tmp_workspace:
8-
SynodicPlugin().poetry_check()
9-
10-
def test_conan_exporting(self, tmp_workspace):
11-
with tmp_workspace:
12-
plugin = SynodicPlugin()
13-
ConanAPIV1().create(
14-
conanfile_path=plugin.data["tool"]["conan"]["install-path"],
15-
name=plugin.data["tool"]["poetry"]["name"],
16-
version=plugin.data["tool"]["poetry"]["version"],
17-
user=None,
18-
channel=None,
19-
profile_names=None,
20-
settings=None,
21-
options=None,
22-
env=None,
23-
test_folder=None,
24-
not_export=False,
25-
build_modes=None,
26-
keep_source=False,
27-
keep_build=False,
28-
verify=None,
29-
manifests=None,
30-
manifests_interactive=None,
31-
remote_name=None,
32-
update=False,
33-
cwd=None,
34-
test_build_folder=None,
35-
lockfile=None,
36-
ignore_dirty=False,
37-
)
1+


0 commit comments

Comments
 (0)