Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_export_cpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Matthew Newson
aidge_export_cpp
Commits
5a7d1b78
Commit
5a7d1b78
authored
1 year ago
by
Vincent Templier
Browse files
Options
Downloads
Patches
Plain Diff
Upgrade setup.py to add version.txt in python package
parent
e86d7974
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.py
+48
-2
48 additions, 2 deletions
setup.py
with
48 additions
and
2 deletions
setup.py
+
48
−
2
View file @
5a7d1b78
#!/usr/bin/env python3
"""
Aidge
E
xport
CPP
"""
Aidge
CPP generic e
xport
"""
DOCLINES
=
(
__doc__
or
''
).
split
(
"
\n
"
)
...
...
@@ -13,24 +13,66 @@ if sys.version_info[:2] < (3, 7):
CLASSIFIERS
=
"""
\
Development Status :: 2 - Pre-Alpha
Intended Audience :: Developers
Intended Audience :: Education
Intended Audience :: Science/Research
License :: OSI Approved :: Eclipse Public License 2.0 (EPL-2.0)
Programming Language :: C++
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3 :: Only
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Artificial Intelligence
Topic :: Software Development
"""
import
os
import
shutil
import
pathlib
from
setuptools
import
setup
from
setuptools
import
setup
,
Extension
from
setuptools
import
find_packages
from
setuptools.command.build_ext
import
build_ext
def
get_project_version
()
->
str
:
aidge_root
=
pathlib
.
Path
().
absolute
()
version
=
open
(
aidge_root
/
"
version.txt
"
,
"
r
"
).
read
().
strip
()
return
version
class
AdditionalExtension
(
Extension
):
def
__init__
(
self
,
name
):
super
().
__init__
(
name
,
sources
=
[])
class
AdditionalBuild
(
build_ext
):
def
run
(
self
):
cwd
=
pathlib
.
Path
().
absolute
()
build_temp
=
cwd
/
"
build
"
if
not
build_temp
.
exists
():
build_temp
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
build_lib
=
pathlib
.
Path
(
self
.
build_lib
)
if
not
build_lib
.
exists
():
build_lib
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
aidge_package
=
build_lib
/
"
aidge_export_cpp
"
# Copy version.txt in aidge_package
os
.
chdir
(
os
.
path
.
dirname
(
__file__
))
shutil
.
copy
(
"
version.txt
"
,
str
(
aidge_package
.
absolute
()))
if
__name__
==
'
__main__
'
:
setup
(
name
=
"
aidge_export_cpp
"
,
version
=
get_project_version
(),
license
=
"
Eclipse Public License 2.0 (EPL-2.0)
"
,
python_requires
=
'
>=3.7
'
,
description
=
DOCLINES
[
0
],
long_description_content_type
=
"
text/markdown
"
,
...
...
@@ -39,4 +81,8 @@ if __name__ == '__main__':
platforms
=
[
"
Linux
"
],
packages
=
find_packages
(
where
=
"
.
"
),
include_package_data
=
True
,
ext_modules
=
[
AdditionalExtension
(
"
aidge_export_cpp
"
)],
cmdclass
=
{
'
build_ext
'
:
AdditionalBuild
,
},
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment