Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
3428ae5
Update test_utility.py
Behemyth Nov 20, 2024
9ba1a31
Update pdm.lock
Behemyth Nov 21, 2024
4e46ae4
Remove Excessive Default Logging
Behemyth Nov 22, 2024
de6a15a
Update pyproject.toml
Behemyth Nov 22, 2024
4567329
Update Chore
Behemyth Dec 4, 2024
6f777d2
Update Org Name
Behemyth Dec 4, 2024
910ce17
Init Conan Plugin
Behemyth Dec 4, 2024
0f86d13
Fix Tests
Behemyth Dec 4, 2024
5738845
Remove Isort
Behemyth Dec 4, 2024
939f06b
Tool Directory
Behemyth Dec 5, 2024
ac6a16e
Write conan_provider
Behemyth Dec 5, 2024
a15915d
Pre-calc Paths
Behemyth Dec 5, 2024
2bec696
Update pdm.lock
Behemyth Dec 9, 2024
b972f2e
Update pdm.lock
Behemyth Dec 22, 2024
7761dec
Update Chore
Behemyth Dec 22, 2024
70ca11d
Fixes
Behemyth Dec 22, 2024
c3e6d37
Update pdm.lock
Behemyth Dec 28, 2024
99c70f3
Fix Entrypoint Mock
Behemyth Dec 28, 2024
286675c
Update schema.py
Behemyth Dec 29, 2024
ceeafe8
Move Plugin Fixtures
Behemyth Dec 29, 2024
f2e86eb
Variant Typing
Behemyth Dec 29, 2024
79a7ce8
Update schema.py
Behemyth Dec 29, 2024
4a9d775
Resolve Data in TmpDirs
Behemyth Dec 29, 2024
b6b1990
CMake Variants
Behemyth Dec 30, 2024
ed3f765
Ya
Behemyth Jan 1, 2025
50bafae
Update fixtures.adoc
Behemyth Jan 1, 2025
2714198
Update fixtures.adoc
Behemyth Jan 1, 2025
59bbec3
Project Root
Behemyth Jan 2, 2025
8f2378c
Update settings.json
Behemyth Jan 2, 2025
78c5987
Update shared.py
Behemyth Jan 2, 2025
b869c7e
Move Conftest to Plugin
Behemyth Jan 2, 2025
5e6d9a0
Fix Top-Level_Includes
Behemyth Jan 2, 2025
b8a31af
Update pdm.lock
Behemyth Feb 11, 2025
de7289e
Update pdm.lock
Behemyth Feb 15, 2025
20938a2
Update pdm.lock
Behemyth Feb 22, 2025
4f2bd46
Add First Example
Behemyth Feb 24, 2025
64b3b66
Move Console Tests to Examples
Behemyth Feb 24, 2025
7e83f3f
Revert "Move Console Tests to Examples"
Behemyth Feb 24, 2025
3ef8e13
Shared Examples Fixture
Behemyth Feb 24, 2025
2b2dff2
Ye
Behemyth Feb 24, 2025
f425a40
Remove Outdated Build Hook
Behemyth Feb 24, 2025
221e6ce
Revert "Ye"
Behemyth Feb 24, 2025
bbe507e
hnm
Behemyth Feb 24, 2025
84aea42
clen
Behemyth Feb 24, 2025
b512fe8
Utility
Behemyth Feb 25, 2025
ab05e9a
Rename
Behemyth Feb 25, 2025
d2ab3ce
Update pdm.lock
Behemyth Mar 6, 2025
6b3d7df
Update Chore
Behemyth Mar 27, 2025
8a239af
Update test_pdm_vcpkg_cmake.py
Behemyth Mar 27, 2025
a51e7d7
Update pdm.lock
Behemyth Mar 28, 2025
1c36734
Move
Behemyth Mar 28, 2025
8ada5d6
Update pdm.lock
Behemyth Mar 28, 2025
78f009c
Example Runner
Behemyth Mar 28, 2025
ef147b1
Update Chore
Behemyth Mar 29, 2025
b4f8272
Remove Util
Behemyth Mar 29, 2025
8132cd8
Update test_schema.py
Behemyth Mar 29, 2025
0631486
Update Chore
Behemyth Mar 29, 2025
fc4c36e
Replace Deprecation
Behemyth Mar 29, 2025
cca8e8b
Move
Behemyth Mar 29, 2025
c47da36
Test
Behemyth Mar 29, 2025
4ac41c5
Update test_vcpkg_cmake.py
Behemyth Mar 29, 2025
7a4f93e
Replace Deprecated
Behemyth Mar 29, 2025
09e31ca
Update pyproject.toml
Behemyth Mar 30, 2025
5e32093
CMake Default Data
Behemyth Mar 30, 2025
dcd9118
Update pdm.lock
Behemyth Mar 30, 2025
cb01fe1
Create documentation-trigger.yml
Behemyth Mar 30, 2025
f8ceb74
y
Behemyth Mar 30, 2025
e19bb72
Update pyproject.toml
Behemyth Mar 30, 2025
9fa9a9c
Update pyproject.toml
Behemyth Mar 30, 2025
d67ac60
Initial Configuration Override
Behemyth Mar 30, 2025
b09b39e
Update pyproject.toml
Behemyth Mar 30, 2025
4642939
Stub Tutorial Files
Behemyth Apr 3, 2025
38b2da3
Update Chore
Behemyth Apr 3, 2025
2b744a6
Merge branch 'development' of https://github.com/Behemyth/CPPython in…
Behemyth Apr 3, 2025
a389afc
Update Chore
Behemyth Apr 6, 2025
1232bb9
Update project.py
Behemyth Apr 7, 2025
c4eb8a5
Update Chore
Behemyth Apr 8, 2025
a4600ef
Update Pydantic Logging
Behemyth Apr 8, 2025
d09e9ed
Print the full location
Behemyth Apr 8, 2025
ccc899b
Update schema.py
Behemyth Apr 8, 2025
faaecde
Config Path
Behemyth Apr 8, 2025
83efa92
Update schema.py
Behemyth Apr 8, 2025
4343318
Arbitrary Types
Behemyth Apr 9, 2025
8adda39
Add Requirement Construction
Behemyth Apr 9, 2025
db0eb32
Update resolution.py
Behemyth Apr 9, 2025
6556997
Vcpkg Dependency Resolution
Behemyth Apr 9, 2025
e6fb1cd
Update schema.py
Behemyth Apr 9, 2025
507236a
Baseline
Behemyth Apr 9, 2025
af4e562
Fix Manisfest
Behemyth Apr 9, 2025
7d2ea1e
Update test_schema.py
Behemyth Apr 9, 2025
6b1f3b6
Update example.py
Behemyth Apr 9, 2025
7bf639f
Update test_vcpkg_cmake.py
Behemyth Apr 9, 2025
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
16 changes: 16 additions & 0 deletions .github/workflows/documentation-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build Documentation
on:
push:
paths:
- docs/**
branches:
- '**'

jobs:
publish_release:
if: github.repository_owner == 'synodic'
uses: synodic/.github/.github/workflows/documentation-trigger.yml@stable
with:
repository: synodic/CPPython-Website
secrets:
PAT: ${{ secrets.CPPYTHON_DOC_PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/python-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:

jobs:
check:
uses: synodic-software/.github/.github/workflows/python-check.yml@stable
uses: synodic/.github/.github/workflows/python-check.yml@stable
4 changes: 2 additions & 2 deletions .github/workflows/python-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:

jobs:
publish_release:
if: github.repository_owner == 'Synodic-Software'
uses: synodic-software/.github/.github/workflows/python-merge.yml@stable
if: github.repository_owner == 'synodic'
uses: synodic/.github/.github/workflows/python-merge.yml@stable
with:
repository_url: https://upload.pypi.org/legacy/
secrets:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:

jobs:
publish_release:
if: github.repository_owner == 'Synodic-Software'
uses: synodic-software/.github/.github/workflows/python-publish.yml@stable
if: github.repository_owner == 'synodic'
uses: synodic/.github/.github/workflows/python-publish.yml@stable
with:
repository_url: https://upload.pypi.org/legacy/
secrets:
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ __pypackages__/
!.vscode/launch.json
!.vscode/extensions.json
/.mypy_cache
node_modules/
build/
node_modules/
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"recommendations": [
"ms-python.mypy-type-checker",
"ms-python.black-formatter",
"asciidoctor.asciidoctor-vscode",
"charliermarsh.ruff"
]
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"mypy-type-checker.reportingScope": "workspace",
"mypy-type-checker.preferDaemon": true,
"mypy-type-checker.importStrategy": "fromEnvironment",
}
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Asher Norland
Copyright (c) 2025 Synodic Software

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
41 changes: 21 additions & 20 deletions cppython/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,18 @@ def find_generators(self) -> list[type[Generator]]:
group_name = 'generator'
plugin_types: list[type[Generator]] = []

entries = entry_points(group=f'cppython.{group_name}')

# Filter entries by type
for entry_point in list(entry_points(group=f'cppython.{group_name}')):
for entry_point in list(entries):
loaded_type = entry_point.load()
if not issubclass(loaded_type, Generator):
self._logger.warning(
f"Found incompatible plugin. The '{loaded_type.name()}' plugin must be an instance of"
f" '{group_name}'"
)
else:
self._logger.warning(f'{group_name} plugin found: {loaded_type.name()} from {getmodule(loaded_type)}')
self._logger.info(f'{group_name} plugin found: {loaded_type.name()} from {getmodule(loaded_type)}')
plugin_types.append(loaded_type)

if not plugin_types:
Expand All @@ -161,16 +163,18 @@ def find_providers(self) -> list[type[Provider]]:
group_name = 'provider'
plugin_types: list[type[Provider]] = []

entries = entry_points(group=f'cppython.{group_name}')

# Filter entries by type
for entry_point in list(entry_points(group=f'cppython.{group_name}')):
for entry_point in list(entries):
loaded_type = entry_point.load()
if not issubclass(loaded_type, Provider):
self._logger.warning(
f"Found incompatible plugin. The '{loaded_type.name()}' plugin must be an instance of"
f" '{group_name}'"
)
else:
self._logger.warning(f'{group_name} plugin found: {loaded_type.name()} from {getmodule(loaded_type)}')
self._logger.info(f'{group_name} plugin found: {loaded_type.name()} from {getmodule(loaded_type)}')
plugin_types.append(loaded_type)

if not plugin_types:
Expand All @@ -190,16 +194,18 @@ def find_source_managers(self) -> list[type[SCM]]:
group_name = 'scm'
plugin_types: list[type[SCM]] = []

entries = entry_points(group=f'cppython.{group_name}')

# Filter entries by type
for entry_point in list(entry_points(group=f'cppython.{group_name}')):
for entry_point in list(entries):
loaded_type = entry_point.load()
if not issubclass(loaded_type, SCM):
self._logger.warning(
f"Found incompatible plugin. The '{loaded_type.name()}' plugin must be an instance of"
f" '{group_name}'"
)
else:
self._logger.warning(f'{group_name} plugin found: {loaded_type.name()} from {getmodule(loaded_type)}')
self._logger.info(f'{group_name} plugin found: {loaded_type.name()} from {getmodule(loaded_type)}')
plugin_types.append(loaded_type)

if not plugin_types:
Expand Down Expand Up @@ -227,20 +233,16 @@ def filter_plugins[T: DataPlugin](
if pinned_name is not None:
for loaded_type in plugin_types:
if loaded_type.name() == pinned_name:
self._logger.warning(
f'Using {group_name} plugin: {loaded_type.name()} from {getmodule(loaded_type)}'
)
self._logger.info(f'Using {group_name} plugin: {loaded_type.name()} from {getmodule(loaded_type)}')
return [loaded_type]

self._logger.warning(f"'{group_name}_name' was empty. Trying to deduce {group_name}s")
self._logger.info(f"'{group_name}_name' was empty. Trying to deduce {group_name}s")

supported_types: list[type[T]] = []

# Deduce types
for loaded_type in plugin_types:
self._logger.warning(
f'A {group_name} plugin is supported: {loaded_type.name()} from {getmodule(loaded_type)}'
)
self._logger.info(f'A {group_name} plugin is supported: {loaded_type.name()} from {getmodule(loaded_type)}')
supported_types.append(loaded_type)

# Fail
Expand All @@ -260,7 +262,7 @@ def select_scm(self, scm_plugins: list[type[SCM]], project_data: ProjectData) ->
The selected SCM plugin type
"""
for scm_type in scm_plugins:
if scm_type.features(project_data.pyproject_file.parent).repository:
if scm_type.features(project_data.project_root).repository:
return scm_type

self._logger.info('No SCM plugin was found that supports the given path')
Expand Down Expand Up @@ -342,7 +344,7 @@ def create_generator(
generator_data = resolve_generator(core_data.project_data, cppython_plugin_data)

if not generator_configuration:
self._logger.error(
self._logger.info(
"The pyproject.toml table 'tool.cppython.generator' does not exist. Sending generator empty data",
)

Expand Down Expand Up @@ -377,7 +379,7 @@ def create_provider(
provider_data = resolve_provider(core_data.project_data, cppython_plugin_data)

if not provider_configuration:
self._logger.error(
self._logger.info(
"The pyproject.toml table 'tool.cppython.provider' does not exist. Sending provider empty data",
)

Expand All @@ -393,17 +395,16 @@ def create_provider(
class Builder:
"""Helper class for building CPPython projects"""

levels = [logging.WARNING, logging.INFO, logging.DEBUG]

def __init__(self, project_configuration: ProjectConfiguration, logger: Logger) -> None:
"""Initializes the builder"""
self._project_configuration = project_configuration
self._logger = logger

# Default logging levels
levels = [logging.WARNING, logging.INFO, logging.DEBUG]

# Add default output stream
self._logger.addHandler(logging.StreamHandler())
self._logger.setLevel(levels[project_configuration.verbosity])
self._logger.setLevel(Builder.levels[project_configuration.verbosity])

self._logger.info('Logging setup complete')

Expand Down
7 changes: 3 additions & 4 deletions cppython/console/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ def main(
debug: Debug mode
"""
path = _find_pyproject_file()
file_path = path / 'pyproject.toml'

project_configuration = ProjectConfiguration(verbosity=verbose, debug=debug, pyproject_file=file_path, version=None)
project_configuration = ProjectConfiguration(verbosity=verbose, debug=debug, project_root=path, version=None)

interface = ConsoleInterface()
context.obj = ConsoleConfiguration(project_configuration=project_configuration, interface=interface)
Expand Down Expand Up @@ -79,7 +78,7 @@ def install(
if (configuration := context.find_object(ConsoleConfiguration)) is None:
raise ValueError('The configuration object is missing')

path = configuration.project_configuration.pyproject_file
path = configuration.project_configuration.project_root / 'pyproject.toml'
pyproject_data = loads(path.read_text(encoding='utf-8'))

project = Project(configuration.project_configuration, configuration.interface, pyproject_data)
Expand All @@ -101,7 +100,7 @@ def update(
if (configuration := context.find_object(ConsoleConfiguration)) is None:
raise ValueError('The configuration object is missing')

path = configuration.project_configuration.pyproject_file
path = configuration.project_configuration.project_root / 'pyproject.toml'
pyproject_data = loads(path.read_text(encoding='utf-8'))

project = Project(configuration.project_configuration, configuration.interface, pyproject_data)
Expand Down
Loading
Loading