Skip to content

Commit 6f1db2d

Browse files
authored
Vcpkg Simple Example (Skipped) (#111)
1 parent 27aa21b commit 6f1db2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1577
-782
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build Documentation
2+
on:
3+
push:
4+
paths:
5+
- docs/**
6+
branches:
7+
- '**'
8+
9+
jobs:
10+
publish_release:
11+
if: github.repository_owner == 'synodic'
12+
uses: synodic/.github/.github/workflows/documentation-trigger.yml@stable
13+
with:
14+
repository: synodic/CPPython-Website
15+
secrets:
16+
PAT: ${{ secrets.CPPYTHON_DOC_PAT }}

.github/workflows/python-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ on:
44

55
jobs:
66
check:
7-
uses: synodic-software/.github/.github/workflows/python-check.yml@stable
7+
uses: synodic/.github/.github/workflows/python-check.yml@stable

.github/workflows/python-merge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66

77
jobs:
88
publish_release:
9-
if: github.repository_owner == 'Synodic-Software'
10-
uses: synodic-software/.github/.github/workflows/python-merge.yml@stable
9+
if: github.repository_owner == 'synodic'
10+
uses: synodic/.github/.github/workflows/python-merge.yml@stable
1111
with:
1212
repository_url: https://upload.pypi.org/legacy/
1313
secrets:

.github/workflows/python-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55

66
jobs:
77
publish_release:
8-
if: github.repository_owner == 'Synodic-Software'
9-
uses: synodic-software/.github/.github/workflows/python-publish.yml@stable
8+
if: github.repository_owner == 'synodic'
9+
uses: synodic/.github/.github/workflows/python-publish.yml@stable
1010
with:
1111
repository_url: https://upload.pypi.org/legacy/
1212
secrets:

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,4 @@ __pypackages__/
2525
!.vscode/launch.json
2626
!.vscode/extensions.json
2727
/.mypy_cache
28-
node_modules/
29-
build/
28+
node_modules/

.vscode/extensions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"recommendations": [
33
"ms-python.mypy-type-checker",
4-
"ms-python.black-formatter",
54
"asciidoctor.asciidoctor-vscode",
65
"charliermarsh.ruff"
76
]

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@
88
"editor.codeActionsOnSave": {
99
"source.organizeImports": "explicit"
1010
},
11+
"mypy-type-checker.reportingScope": "workspace",
12+
"mypy-type-checker.preferDaemon": true,
13+
"mypy-type-checker.importStrategy": "fromEnvironment",
1114
}

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Asher Norland
3+
Copyright (c) 2025 Synodic Software
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

cppython/builder.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,18 @@ def find_generators(self) -> list[type[Generator]]:
132132
group_name = 'generator'
133133
plugin_types: list[type[Generator]] = []
134134

135+
entries = entry_points(group=f'cppython.{group_name}')
136+
135137
# Filter entries by type
136-
for entry_point in list(entry_points(group=f'cppython.{group_name}')):
138+
for entry_point in list(entries):
137139
loaded_type = entry_point.load()
138140
if not issubclass(loaded_type, Generator):
139141
self._logger.warning(
140142
f"Found incompatible plugin. The '{loaded_type.name()}' plugin must be an instance of"
141143
f" '{group_name}'"
142144
)
143145
else:
144-
self._logger.warning(f'{group_name} plugin found: {loaded_type.name()} from {getmodule(loaded_type)}')
146+
self._logger.info(f'{group_name} plugin found: {loaded_type.name()} from {getmodule(loaded_type)}')
145147
plugin_types.append(loaded_type)
146148

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

166+
entries = entry_points(group=f'cppython.{group_name}')
167+
164168
# Filter entries by type
165-
for entry_point in list(entry_points(group=f'cppython.{group_name}')):
169+
for entry_point in list(entries):
166170
loaded_type = entry_point.load()
167171
if not issubclass(loaded_type, Provider):
168172
self._logger.warning(
169173
f"Found incompatible plugin. The '{loaded_type.name()}' plugin must be an instance of"
170174
f" '{group_name}'"
171175
)
172176
else:
173-
self._logger.warning(f'{group_name} plugin found: {loaded_type.name()} from {getmodule(loaded_type)}')
177+
self._logger.info(f'{group_name} plugin found: {loaded_type.name()} from {getmodule(loaded_type)}')
174178
plugin_types.append(loaded_type)
175179

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

197+
entries = entry_points(group=f'cppython.{group_name}')
198+
193199
# Filter entries by type
194-
for entry_point in list(entry_points(group=f'cppython.{group_name}')):
200+
for entry_point in list(entries):
195201
loaded_type = entry_point.load()
196202
if not issubclass(loaded_type, SCM):
197203
self._logger.warning(
198204
f"Found incompatible plugin. The '{loaded_type.name()}' plugin must be an instance of"
199205
f" '{group_name}'"
200206
)
201207
else:
202-
self._logger.warning(f'{group_name} plugin found: {loaded_type.name()} from {getmodule(loaded_type)}')
208+
self._logger.info(f'{group_name} plugin found: {loaded_type.name()} from {getmodule(loaded_type)}')
203209
plugin_types.append(loaded_type)
204210

205211
if not plugin_types:
@@ -227,20 +233,16 @@ def filter_plugins[T: DataPlugin](
227233
if pinned_name is not None:
228234
for loaded_type in plugin_types:
229235
if loaded_type.name() == pinned_name:
230-
self._logger.warning(
231-
f'Using {group_name} plugin: {loaded_type.name()} from {getmodule(loaded_type)}'
232-
)
236+
self._logger.info(f'Using {group_name} plugin: {loaded_type.name()} from {getmodule(loaded_type)}')
233237
return [loaded_type]
234238

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

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

239243
# Deduce types
240244
for loaded_type in plugin_types:
241-
self._logger.warning(
242-
f'A {group_name} plugin is supported: {loaded_type.name()} from {getmodule(loaded_type)}'
243-
)
245+
self._logger.info(f'A {group_name} plugin is supported: {loaded_type.name()} from {getmodule(loaded_type)}')
244246
supported_types.append(loaded_type)
245247

246248
# Fail
@@ -260,7 +262,7 @@ def select_scm(self, scm_plugins: list[type[SCM]], project_data: ProjectData) ->
260262
The selected SCM plugin type
261263
"""
262264
for scm_type in scm_plugins:
263-
if scm_type.features(project_data.pyproject_file.parent).repository:
265+
if scm_type.features(project_data.project_root).repository:
264266
return scm_type
265267

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

344346
if not generator_configuration:
345-
self._logger.error(
347+
self._logger.info(
346348
"The pyproject.toml table 'tool.cppython.generator' does not exist. Sending generator empty data",
347349
)
348350

@@ -377,7 +379,7 @@ def create_provider(
377379
provider_data = resolve_provider(core_data.project_data, cppython_plugin_data)
378380

379381
if not provider_configuration:
380-
self._logger.error(
382+
self._logger.info(
381383
"The pyproject.toml table 'tool.cppython.provider' does not exist. Sending provider empty data",
382384
)
383385

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

398+
levels = [logging.WARNING, logging.INFO, logging.DEBUG]
399+
396400
def __init__(self, project_configuration: ProjectConfiguration, logger: Logger) -> None:
397401
"""Initializes the builder"""
398402
self._project_configuration = project_configuration
399403
self._logger = logger
400404

401-
# Default logging levels
402-
levels = [logging.WARNING, logging.INFO, logging.DEBUG]
403-
404405
# Add default output stream
405406
self._logger.addHandler(logging.StreamHandler())
406-
self._logger.setLevel(levels[project_configuration.verbosity])
407+
self._logger.setLevel(Builder.levels[project_configuration.verbosity])
407408

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

cppython/console/entry.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ def main(
4949
debug: Debug mode
5050
"""
5151
path = _find_pyproject_file()
52-
file_path = path / 'pyproject.toml'
5352

54-
project_configuration = ProjectConfiguration(verbosity=verbose, debug=debug, pyproject_file=file_path, version=None)
53+
project_configuration = ProjectConfiguration(verbosity=verbose, debug=debug, project_root=path, version=None)
5554

5655
interface = ConsoleInterface()
5756
context.obj = ConsoleConfiguration(project_configuration=project_configuration, interface=interface)
@@ -79,7 +78,7 @@ def install(
7978
if (configuration := context.find_object(ConsoleConfiguration)) is None:
8079
raise ValueError('The configuration object is missing')
8180

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

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

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

107106
project = Project(configuration.project_configuration, configuration.interface, pyproject_data)

0 commit comments

Comments
 (0)