Skip to content
Snippets Groups Projects
Commit a5b7b942 authored by Grégoire Kubler's avatar Grégoire Kubler
Browse files

fix: setup.py now functions with name from pyproject.toml + fixed script .ps1 for aidge core

parent 2968bd74
No related branches found
No related tags found
2 merge requests!212Version 0.3.0,!116feat/release_pip
Pipeline #45158 canceled
if ($env:AIDGE_DEPENDENCIES.Length -split " " -eq 0) {
if ($($env:AIDGE_DEPENDENCIES -split " ").Length -eq 0) {
Write-Host "- No dependencies provided for current repsitory"
New-Item -ItemType Directory -Force -Path ".\build" | Out-Null
Remove-Item -Path ".\build\*" -Recurse -Force
} else {
Write-Host "Retrieving given dependencies to build current package : $($deps -join ',')"
foreach ($dep in $env:AIDGE_DEPENDENCIES -split " ") {
Write-Host "Retrieving given dependencies to build current package : $env:AIDGE_DEPENDENCIES"
foreach ($dep in $($env:AIDGE_DEPENDENCIES -split " ")) {
Write-Host "Retrieving : $dep"
$dep_path = Get-ChildItem -Path "/host/home/" -Directory -Filter $dep -Recurse |
Where-Object { $_.FullName -notmatch 'install' -and
......@@ -23,7 +23,7 @@ if ($env:AIDGE_DEPENDENCIES.Length -split " " -eq 0) {
New-Item -Path ".\build" -ItemType Directory -Force | Out-Null
Get-ChildItem -Path ".\build" -File | Remove-Item -Force
pip install . -Verbose
} else {
} else {
throw "$dep not found, aborting."
}
}
......
......@@ -12,15 +12,28 @@ classifiers = [
dynamic = ["version"] # defined in tool.setuptools_scm
[build-system]
requires = ["setuptools>=68", "setuptools-scm", "cmake"]
requires = [
"setuptools>=64",
"setuptools_scm[toml]==7.1.0",
"cmake",
"toml"
]
build-backend = "setuptools.build_meta"
#####################################################
# SETUPTOOLS
[tool.setuptools]
#####################################################
# SETUPTOOLS_SCM
[tool.setuptools_scm]
write_to = "aidge_core/_version.py"
#####################################################
# CIBUILDWHEEL
[tool.cibuildwheel]
build-frontend = "build"
############## AIDGE DEPENDENCIES DECLARATION
### AIDGE DEPENDENCIES DECLARATION
# aidge_core do not rely on any aidge dependency, hence this string is empty
[tool.cibuildwheel.linux.environment]
# AIDGE_DEPENDENCIES = "" # format => "dep_1 dep_2 ... dep_n"
......@@ -29,22 +42,13 @@ build-frontend = "build"
[tool.cibuildwheel.linux]
before-build = [
'echo "dependencies to retrieve : ${AIDGE_DEPENDENCIES}"',
"bash .gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh ${AIDGE_DEPENDENCIES}"
]
[tool.cibuildwheel.windows]
before-build = [
'Write-Host "dependencies to retrieve : $env:{AIDGE_DEPENDENCIES}"',
".\\.gitlab\\ci\\cibuildwheel_build_deps_before_build_wheel.ps1"
"powershell -File .\\.gitlab\\ci\\cibuildwheel_build_deps_before_build_wheel.ps1"
]
#####################################################
# SETUPTOOLS
[tool.setuptools]
# packages=["aidge_core", "export"]
[tool.setuptools_scm]
version_file = "_version.py"
#####################################################
# PYLINT
......
......@@ -9,19 +9,18 @@ import multiprocessing
from math import ceil
import toml
from setuptools import setup, Extension
from setuptools import find_packages
from setuptools.command.build_ext import build_ext
def get_project_name() -> str:
return open(pathlib.Path().absolute() / "project_name.txt", "r").read()
with open(pathlib.Path().absolute() / "pyproject.toml", "r") as file :
project_toml = toml.load(file)
print(f"project_name = {project_toml["project"]["name"]}")
return project_toml["project"]["name"]
def get_project_version() -> str:
aidge_root = pathlib.Path().absolute()
version = open(aidge_root / "version.txt", "r").read().strip()
return version
class CMakeExtension(Extension):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment