Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DQSegDB Client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IGWN Computing and Software
DQSegDB
DQSegDB Client
Commits
6cfcb294
Commit
6cfcb294
authored
10 years ago
by
Ryan Fisher
Browse files
Options
Downloads
Patches
Plain Diff
Attempting to apply Duncan M patch to fix setuptools use in setup.py
parent
6c0b4cab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.py
+68
-28
68 additions, 28 deletions
setup.py
with
68 additions
and
28 deletions
setup.py
+
68
−
28
View file @
6cfcb294
...
...
@@ -6,13 +6,10 @@ from __future__ import print_function
import
sys
import
glob
import
os.path
from
distutils.command
import
install
import
subprocess
from
distutils
import
log
from
setuptools
import
(
setup
,
find_packages
)
try
:
utils
=
__import__
(
'
utils
'
,
fromlist
=
[
'
version
'
],
level
=
1
)
except
:
import
utils
from
setuptools.command
import
(
build_py
,
install
,
sdist
)
PACKAGENAME
=
'
dqsegdb
'
DESCRIPTION
=
'
Client library for DQSegDB
'
...
...
@@ -21,34 +18,50 @@ AUTHOR = 'Ryan Fisher'
AUTHOR_EMAIL
=
'
ryan.fisher@ligo.org
'
LICENSE
=
None
# set version information
VERSION_PY
=
'
%s/version.py
'
%
PACKAGENAME
vcinfo
=
utils
.
version
.
GitStatus
()
vcinfo
(
VERSION_PY
,
PACKAGENAME
,
AUTHOR
,
AUTHOR_EMAIL
)
#
VERSION should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386)
VERSION
=
vcinfo
.
version
#
------------------------------------------------------------------------------
# VCS info
# Indicates if this version is a release version
RELEASE
=
vcinfo
.
version
!=
vcinfo
.
id
and
'
dev
'
not
in
VERSION
version_py
=
os
.
path
.
join
(
PACKAGENAME
,
'
version.py
'
)
# Use the find_packages tool to locate all packages and modules
packagenames
=
find_packages
(
exclude
=
[
'
utils
'
,
'
utils.*
'
])
# glob for all scripts
if
os
.
path
.
isdir
(
'
bin
'
):
scripts
=
glob
.
glob
(
os
.
path
.
join
(
'
bin
'
,
'
*
'
))
else
:
scripts
=
[]
def
write_vcs_info
(
target
):
"""
Generate target file with versioning information from git VCS
"""
log
.
info
(
"
generating %s
"
%
target
)
import
vcs
gitstatus
=
vcs
.
GitStatus
()
gitstatus
.
run
(
target
,
PACKAGENAME
,
AUTHOR
,
AUTHOR_EMAIL
)
# ------------------------------------------------------------------------------
# custom commands
class
DQSegDBBuildPy
(
build_py
.
build_py
):
def
run
(
self
):
try
:
write_vcs_info
(
version_py
)
except
subprocess
.
CalledProcessError
:
# failed to generate version.py because git call did'nt work
if
os
.
path
.
exists
(
version_py
):
log
.
info
(
"
cannot determine git status, using existing %s
"
%
version_py
)
build_py
.
build_py
.
run
(
self
)
class
DQSegDBSDist
(
sdist
.
sdist
):
def
run
(
self
):
write_vcs_info
(
version_py
)
sdist
.
sdist
.
run
(
self
)
# extend install to write environment scripts
shenv
=
os
.
path
.
join
(
'
etc
'
,
'
%s-user-env.sh
'
%
PACKAGENAME
)
cshenv
=
os
.
path
.
join
(
'
etc
'
,
'
%s-user-env.csh
'
%
PACKAGENAME
)
class
DQSegDBInstall
(
install
.
install
):
"""
Extension of setuptools install to write source script for
users.
"""
shenv
=
os
.
path
.
join
(
'
etc
'
,
'
%s-user-env.sh
'
%
PACKAGENAME
)
cshenv
=
os
.
path
.
join
(
'
etc
'
,
'
%s-user-env.csh
'
%
PACKAGENAME
)
def
_get_install_paths
(
self
):
"""
Internal utility to get install and library paths for install.
"""
...
...
@@ -98,21 +111,48 @@ class DQSegDBInstall(install.install):
print
(
"
DQSegDB has been installed.
"
)
print
(
"
If you are running csh, you can set your environment by
"
"
running:
\n
"
)
print
(
"
source %s
\n
"
%
os
.
path
.
join
(
self
.
install_base
,
cshenv
))
print
(
"
source %s
\n
"
%
os
.
path
.
join
(
self
.
install_base
,
self
.
cshenv
))
print
(
"
Otherwise, you can run:
\n
"
)
print
(
"
source %s
"
%
os
.
path
.
join
(
self
.
install_base
,
shenv
))
print
(
"
source %s
"
%
os
.
path
.
join
(
self
.
install_base
,
self
.
shenv
))
print
(
"
--------------------------------------------------
"
)
run
.
__doc__
=
install
.
install
.
__doc__
# ------------------------------------------------------------------------------
# run setup
# get version metadata
try
:
from
dqsegdb
import
version
except
ImportError
:
VERSION
=
None
RELEASE
=
False
else
:
VERSION
=
version
.
version
RELEASE
=
version
.
version
!=
version
.
git_id
and
'
dev
'
not
in
VERSION
# Use the find_packages tool to locate all packages and modules
packagenames
=
find_packages
()
# glob for all scripts
if
os
.
path
.
isdir
(
'
bin
'
):
scripts
=
glob
.
glob
(
os
.
path
.
join
(
'
bin
'
,
'
*
'
))
else
:
scripts
=
[]
setup
(
name
=
PACKAGENAME
,
cmdclass
=
{
'
install
'
:
DQSegDBInstall
},
cmdclass
=
{
'
install
'
:
DQSegDBInstall
,
'
build_py
'
:
DQSegDBBuildPy
,
'
sdist
'
:
DQSegDBSDist
,
},
version
=
VERSION
,
description
=
DESCRIPTION
,
packages
=
packagenames
,
ext_modules
=
[],
scripts
=
scripts
,
data_files
=
[(
'
etc
'
,
[
shenv
,
cshenv
])],
data_files
=
[(
'
etc
'
,
[
DQSegDBInstall
.
shenv
,
DQSegDBInstall
.
cshenv
])],
install_requires
=
[
'
glue
'
,
'
pyRXP
'
],
provides
=
[
PACKAGENAME
],
author
=
AUTHOR
,
...
...
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