Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Swigcsm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aflab
astrogeology
Swigcsm
Commits
ea52864b
Commit
ea52864b
authored
6 years ago
by
jay
Browse files
Options
Downloads
Patches
Plain Diff
Correct installation
parent
7302d240
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
python/setup.py.in
+23
-2
23 additions, 2 deletions
python/setup.py.in
tests/test_functional.py
+3
-1
3 additions, 1 deletion
tests/test_functional.py
with
26 additions
and
3 deletions
python/setup.py.in
+
23
−
2
View file @
ea52864b
...
@@ -2,13 +2,34 @@ import setuptools.command.install
...
@@ -2,13 +2,34 @@ import setuptools.command.install
import shutil
import shutil
from distutils.sysconfig import get_python_lib
from distutils.sysconfig import get_python_lib
class CompiledLibInstall(setuptools.command.install.install):
"""
Specialized install to install to python libs
"""
def run(self):
"""
Run method called by setup
:return:
"""
# Get filenames from CMake variable
filenames = '${PYTHON_INSTALL_FILES}'.split(';')
# Directory to install to
install_dir = get_python_lib()
# Install files
[shutil.copy(filename, install_dir) for filename in filenames]
if __name__ == '__main__':
if __name__ == '__main__':
setuptools.setup(
setuptools.setup(
name='csmapi',
name='csmapi',
version='0.1.0',
version='0.1.0',
p
y_modul
es=['csmapi'],
p
ackag
es=['csmapi'],
package_data={'csmapi':['_csmapi.so']
},
cmdclass={'install':CompiledLibInstall
},
license='UnLicense',
license='UnLicense',
author='jlaura',
author='jlaura',
zip_safe=False,
author_email='jlaura@usgs.gov'
author_email='jlaura@usgs.gov'
)
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/test_functional.py
+
3
−
1
View file @
ea52864b
...
@@ -8,7 +8,9 @@ import pytest
...
@@ -8,7 +8,9 @@ import pytest
import
csmapi
import
csmapi
# Load a plugin with CSM compliant sensors
# Load a plugin with CSM compliant sensors
lib
=
ctypes
.
CDLL
(
'
/data/big/github/CSM-CameraModel/build/libusgscsm.so
'
)
from
ctypes.util
import
find_library
lib
=
ctypes
.
CDLL
(
find_library
(
'
usgscsm.so
'
))
@pytest.fixture
@pytest.fixture
def
datadir
(
tmpdir
,
request
):
def
datadir
(
tmpdir
,
request
):
...
...
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