2024-09-26 10:23:17 +02:00
|
|
|
# oscillode
|
|
|
|
# Copyright (C) 2024 oscillode Project Contributors
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Affero General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2024-05-04 22:29:40 +02:00
|
|
|
# blender_maxwell
|
|
|
|
# Copyright (C) 2024 blender_maxwell Project Contributors
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Affero General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2024-03-20 12:55:40 +01:00
|
|
|
import tomllib
|
|
|
|
from pathlib import Path
|
|
|
|
|
2024-09-26 13:33:25 +02:00
|
|
|
####################
|
|
|
|
# - Basic
|
|
|
|
####################
|
|
|
|
PATH_ROOT = Path(__file__).resolve().parent.parent
|
|
|
|
with (PATH_ROOT / 'pyproject.toml').open('rb') as f:
|
|
|
|
PROJ_SPEC = tomllib.load(f)
|
2024-04-07 18:39:27 +02:00
|
|
|
|
2024-09-26 13:33:25 +02:00
|
|
|
REQ_PYTHON_VERSION = PROJ_SPEC['project']['requires-python'].replace('~= ', '')
|
2024-03-20 12:55:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
####################
|
2024-09-26 13:33:25 +02:00
|
|
|
# - Paths
|
2024-03-20 12:55:40 +01:00
|
|
|
####################
|
2024-09-26 13:33:25 +02:00
|
|
|
def proc_path(p_str: str) -> Path:
|
|
|
|
return PATH_ROOT / Path(*p_str.split('/'))
|
2024-03-20 12:55:40 +01:00
|
|
|
|
|
|
|
|
2024-09-26 13:33:25 +02:00
|
|
|
PATH_PKG = PATH_ROOT / PROJ_SPEC['project']['name']
|
2024-03-20 12:55:40 +01:00
|
|
|
|
2024-09-26 13:33:25 +02:00
|
|
|
PATH_DEV = PATH_ROOT / 'dev'
|
|
|
|
PATH_DEV.mkdir(exist_ok=True)
|
2024-03-20 12:55:40 +01:00
|
|
|
|
2024-09-26 13:33:25 +02:00
|
|
|
# Retrieve Build Path
|
|
|
|
## Extension ZIP files will be placed here after packaging.
|
|
|
|
PATH_BUILD = proc_path(PROJ_SPEC['tool']['bl_ext']['packaging']['path_builds'])
|
|
|
|
PATH_BUILD.mkdir(exist_ok=True)
|
2024-03-20 12:55:40 +01:00
|
|
|
|
2024-09-26 13:33:25 +02:00
|
|
|
# Retrieve Wheels Path
|
|
|
|
## Dependency wheels will be downloaded to here, then copied into the extension packages.
|
|
|
|
PATH_WHEELS = proc_path(PROJ_SPEC['tool']['bl_ext']['packaging']['path_wheels'])
|
|
|
|
PATH_WHEELS.mkdir(exist_ok=True)
|
2024-03-20 12:55:40 +01:00
|
|
|
|
2024-09-26 13:33:25 +02:00
|
|
|
# Retrieve Local Cache Path
|
|
|
|
## During development, files such as logs will be placed here instead of in the extension's user path.
|
|
|
|
## This is essentially a debugging convenience.
|
|
|
|
PATH_LOCAL = proc_path(PROJ_SPEC['tool']['bl_ext']['packaging']['path_local'])
|
|
|
|
PATH_LOCAL.mkdir(exist_ok=True)
|
feat: Working logging, before- and after-deps.
We have a far more sane approach to nodeps now, which
allows us to essentially have two loggers - one that is
very useful, pretty, and clear, but requires a 'rich'
dependency, and one that is simple.
In this spirit, we factored out services/ too.
We can also set the initial console log level now when
packing the .zip.
There's still work to do with the actual flow for deps
installing / uninstalling.
But it should be far more robust now.
Finally, we have a barebones working `quartodoc`-based docs site.
It's super clever; see <https://github.com/machow/quartodoc>.
As it's "just" a quarto project with some python autodiscovery,
fleshing it out with ex. math, images, diagrams, and so forth
should be exceptionally easy.
As we develop, various linter-guided fixes are being realized.
This will be a long process, best done as we spiff everything up
in preparation for general release.
2024-03-21 18:45:38 +01:00
|
|
|
|
2024-03-20 12:55:40 +01:00
|
|
|
####################
|
2024-09-26 13:33:25 +02:00
|
|
|
# - Computed Paths
|
2024-03-20 12:55:40 +01:00
|
|
|
####################
|
2024-09-26 13:33:25 +02:00
|
|
|
# Compute Current ZIP to Build
|
|
|
|
## The concrete path to the file that will be packed and installed.
|
|
|
|
PATH_ZIP = PATH_BUILD / (
|
|
|
|
PROJ_SPEC['project']['name'] + '__' + PROJ_SPEC['project']['version'] + '.zip'
|
|
|
|
)
|