Skip to content

Decompose Into Plugins #13

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

Merged
merged 126 commits into from
Nov 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
d27c24d
Initial Commit
Behemyth Oct 23, 2019
817e9f2
Simple Install + Update
Behemyth Dec 20, 2019
eca6102
CLI forwarding
Behemyth Dec 30, 2019
f776f4e
Update Actions
Behemyth Dec 30, 2019
4c5dbb6
Update Job Names
Behemyth Dec 30, 2019
c071dd9
Workflow Bugfix
Behemyth Dec 30, 2019
a632551
Merge branch 'development' of https://github.com/Synodic-Software/Con…
Behemyth Dec 30, 2019
7b0cc09
RM
Behemyth Dec 30, 2019
6bcf3de
Merge branch 'development' of https://github.com/Synodic-Software/Con…
Behemyth Dec 30, 2019
0a0bed0
Rename + Remove Temp CLI
Behemyth Dec 30, 2019
000c152
Update README
Behemyth Dec 30, 2019
5049cb1
Update
Behemyth Dec 30, 2019
2a15cb4
Update Some Infra
Behemyth Feb 7, 2020
5a06ee9
Rename
Behemyth Jul 16, 2020
071a6f9
Merge branch 'development' of https://github.com/Synodic-Software/Syn…
Behemyth Jul 16, 2020
ee11693
RM
Behemyth Jul 16, 2020
4a8f12e
Update
Behemyth Mar 1, 2021
c90e2f1
Fix Test Init
Behemyth Mar 1, 2021
bf12b81
Format
Behemyth Mar 1, 2021
0335fb5
Update
Behemyth Mar 4, 2021
e0e5e71
Remove explicit flake8 dep
Behemyth Mar 30, 2021
16479f7
Use pylint
Behemyth Apr 1, 2021
ca01b57
Use Poetry main branch
Behemyth Apr 2, 2021
db45573
Updates
Behemyth Apr 2, 2021
85d1f55
Cleanup tests
Behemyth Apr 3, 2021
27e13fc
Fix Test IDs
Behemyth Apr 3, 2021
49ae392
Yield the workspace
Behemyth Apr 3, 2021
0e4cdb6
oof
Behemyth Apr 4, 2021
d40b179
ye
Behemyth Apr 9, 2021
47ef989
Test
Behemyth Apr 21, 2021
54ef97c
Click Interface
Behemyth Apr 22, 2021
0632f59
Implement Click frontend
Behemyth Apr 22, 2021
02b5db2
Stub API
Behemyth Apr 22, 2021
975062d
Fix err
Behemyth Apr 22, 2021
31fca30
yes
Behemyth Apr 22, 2021
bac0b59
ye
Behemyth Apr 29, 2021
15fafa1
Properties
Behemyth Apr 29, 2021
04e2da0
Fix Tests
Behemyth Apr 29, 2021
f53e9ba
up
Behemyth Apr 29, 2021
394c9bd
ye
Behemyth Apr 29, 2021
8dee675
ye
Behemyth Apr 30, 2021
ec5277a
Update CWD location
Behemyth Apr 30, 2021
965f0a4
Setup Plugin
Behemyth Apr 30, 2021
54c33e0
io
Behemyth Apr 30, 2021
c71cc4e
Move Fixtures
Behemyth Apr 30, 2021
2aa16be
Remove main entrypoint
Behemyth May 1, 2021
c6fc591
TODO
Behemyth May 1, 2021
03f664c
Consolidate Commands
Behemyth May 1, 2021
96902df
Comment out Plugin tests
Behemyth May 1, 2021
7b6cde4
Uncomment
Behemyth May 1, 2021
0983e39
Add Cerberus
Behemyth May 1, 2021
b70b314
Partial Property Validation
Behemyth May 1, 2021
3b2fd64
Attribute Set
Behemyth May 2, 2021
c60459c
te
Behemyth May 6, 2021
fa7e0e6
Cleanup
Behemyth May 7, 2021
d4e3d6f
smoll fix
Behemyth May 7, 2021
919be18
Rename
Behemyth May 9, 2021
4e5e91f
Finish renaming
Behemyth May 9, 2021
57f1a41
ye
Behemyth May 11, 2021
c49b0ad
Dummy Data
Behemyth May 11, 2021
cd603ce
Read + Validate
Behemyth May 12, 2021
fb322df
stttuff
Behemyth May 16, 2021
8c3dae1
Upkeep
Behemyth Jun 7, 2021
60b0cc4
ya
Behemyth Jun 10, 2021
3b72306
Updates
Behemyth Jun 14, 2021
c5e26e0
yes
Behemyth Jun 14, 2021
912092f
Update
Behemyth Jun 14, 2021
6eefacd
Project Validation
Behemyth Jun 17, 2021
9f93f58
Fix enabled + Update
Behemyth Jun 17, 2021
544ffa2
Dataclasses
Behemyth Jun 17, 2021
aa37fc6
doc
Behemyth Jun 17, 2021
b3a05e1
No longer use lazy validation
Behemyth Jun 22, 2021
b124d99
Some plugin stuuuuuf
Behemyth Jun 22, 2021
4aa585a
Def updates
Behemyth Jun 22, 2021
923fb04
Chore
Behemyth Jun 25, 2021
2bd6e06
Validation Changes
Behemyth Jun 27, 2021
a38140f
Dep
Behemyth Jun 27, 2021
ef97460
Installation
Behemyth Jun 27, 2021
ca697fa
Working Test
Behemyth Jun 28, 2021
cba7b3d
Fix Tests
Behemyth Jun 28, 2021
fc01108
Add pytest-cov
Behemyth Jun 28, 2021
4c83fe5
Add Generators
Behemyth Jun 29, 2021
c45e79b
Remove Junk
Behemyth Jun 29, 2021
dd6cfcd
Remove more junk
Behemyth Jun 29, 2021
bccfb27
Update poetry.lock
Behemyth Jun 29, 2021
de19d7f
Update + Delete Data
Behemyth Jun 30, 2021
0703fe6
Clean Remaining Tests
Behemyth Jun 30, 2021
dbb5ef1
Update Deps
Behemyth Jun 30, 2021
75e4125
Cleanup
Behemyth Jul 1, 2021
8b3a159
Property
Behemyth Jul 1, 2021
38f9d20
Remove built-in plugins
Behemyth Jul 1, 2021
e9fa080
Remove API class
Behemyth Jul 1, 2021
5e5213c
Move Tests around
Behemyth Jul 1, 2021
a27c7b2
Pylint Update
Behemyth Jul 2, 2021
52bc900
Update
Behemyth Jul 6, 2021
a54e664
Task
Behemyth Jul 7, 2021
8bb4f0e
Updates
Behemyth Jul 8, 2021
f57a428
deps
Behemyth Jul 8, 2021
bb5f90f
Exceptions
Behemyth Jul 8, 2021
1fc466d
ya
Behemyth Jul 18, 2021
174652e
Chore
Behemyth Jul 20, 2021
ba83584
Deps
Behemyth Jul 23, 2021
817ee58
Deps
Behemyth Jul 28, 2021
c57b0f6
Deps
Behemyth Aug 4, 2021
3f0b27b
Test Plugin
Behemyth Aug 14, 2021
a26c6b3
ya
Behemyth Aug 14, 2021
021efd0
yaya
Behemyth Aug 19, 2021
261982e
Update
Behemyth Aug 19, 2021
c705a8a
Fix
Behemyth Aug 19, 2021
caec10e
Move around genera
Behemyth Aug 19, 2021
218903c
updates
Behemyth Aug 19, 2021
8007102
yaya
Behemyth Aug 19, 2021
d8ff210
ya
Behemyth Aug 19, 2021
f33cf87
yaya
Behemyth Aug 19, 2021
2302d20
Mock
Behemyth Aug 19, 2021
f8640eb
Pass tests
Behemyth Aug 23, 2021
5525bc8
Dep Update
Behemyth Aug 24, 2021
11e8de4
Deps
Behemyth Aug 26, 2021
db02a11
ya
Behemyth Aug 30, 2021
7fd4d9c
ya
Behemyth Aug 30, 2021
3e20fba
name fix
Behemyth Aug 30, 2021
4bda147
Deps
Behemyth Sep 3, 2021
b5bd89d
chore
Behemyth Sep 12, 2021
e6e2fd8
Remove Workflows
Behemyth Nov 28, 2021
884555e
Update README
Behemyth Nov 28, 2021
622ea3e
Merge branch 'development' of https://github.com/Synodic-Software/CPP…
Behemyth Nov 28, 2021
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
6 changes: 0 additions & 6 deletions .github/pr-labeler.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/release-drafter.yml

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/pr-check.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/publish.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/push-development.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/push-release.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Poetic Conan
A Plugin for Poetry that enables a transparent Conan and CMake workflow.
# CPPython
A library for managing dependencies with CMake for C++ projects.
1 change: 1 addition & 0 deletions cppython/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

13 changes: 13 additions & 0 deletions cppython/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
Custom exceptions used by CPPython
"""

class ConfigError(Exception):
def __init__(self, error: Exception) -> None:
self._error = error

super().__init__(str(error))

@property
def error(self) -> Exception:
return self._error
1 change: 1 addition & 0 deletions cppython/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions cppython/plugins/generator/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

50 changes: 50 additions & 0 deletions cppython/plugins/generator/cmake.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from cppython.schema import Generator, Metadata


class CMakeGenerator(Generator):
"""
A CPPython generator implementing a CMake backend
"""

def __init__(self) -> None:
pass

"""
Plugin Contract
"""

@staticmethod
def name() -> str:
"""
The name of the generator
"""
return "cmake"

"""
Generator Contract
"""

def populate_metadata(self, data: dict):
"""
data - The CPPoetry data taken from pyproject.toml
"""
pass

def populate_plugin(self, data: dict):
"""
data - The data taken from pyproject.toml that belongs to this generator
"""
pass

"""
API Contract
"""

def install(self) -> None:
raise NotImplementedError()

def update(self) -> None:
raise NotImplementedError()

def build(self) -> None:
raise NotImplementedError()
1 change: 1 addition & 0 deletions cppython/plugins/interface/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

119 changes: 119 additions & 0 deletions cppython/plugins/interface/console.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
from cppython.project import Project
from cppython.schema import Interface, PEP621
from pathlib import Path

import click
import tomlkit


def _read_data():
path = Path.cwd()

while not path.glob("pyproject.toml"):
if path.is_absolute():
assert (
"This is not a valid project. No pyproject.toml found in the current directory or any of its parents."
)

return tomlkit.loads(Path(path / "pyproject.toml").read_text(encoding="utf-8"))


class Config(object):
"""
The data object that will be expanded alongside 'pass_obj'
"""

def __init__(self):

data = _read_data()

# Initialize the object hook into CPPython
interface = ConsoleInterface(data)

# Initialize the CPPython context
self.project = Project(interface)

def load(self):
self.project.load()


pass_config = click.make_pass_decorator(Config)


@click.group()
@click.pass_context
def cli(context):
context.ensure_object(Config)

# Initialize cppython
context.obj.load()


@cli.command()
@pass_config
def install(config):
config.project.install()


@cli.command()
@pass_config
def update(config):
config.project.update()


@cli.result_callback()
@pass_config
def cleanup(config, result):
pass


class ConsoleInterface(Interface):
"""
TODO: Description
"""

def __init__(self, data: dict) -> None:
self._data = data

"""
Plugin Contract
"""

@staticmethod
def name() -> str:
"""
The name of the generator
"""
return "console"

"""
Interface Contract
"""

@staticmethod
def external_config() -> bool:
"""
True if the plugin can read its own configuration.
False otherwise
"""

return False

@staticmethod
def parse_pep_621(data: dict) -> PEP621:
"""
Requests the plugin to read the available PEP 621 information. Only requested if the plugin is not the entrypoint
"""
raise NotImplementedError()

def pep_621(self) -> PEP621:
"""
Requests PEP 621 information from the pyproject
"""
return self.parse_pep_621(self._data)

def write_pyproject(self) -> None:
raise NotImplementedError()

def read_pyproject(self) -> dict:
return self._data
1 change: 1 addition & 0 deletions cppython/plugins/test/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading