Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
7f9e30fd
Commit
7f9e30fd
authored
Jan 18, 2012
by
Kostas Papadimitriou
Browse files
Merge branch 'packaging-kpap'
parents
bdc5ee13
e86cff8e
Changes
10
Hide whitespace changes
Inline
Side-by-side
fabfile.py
View file @
7f9e30fd
...
...
@@ -47,6 +47,11 @@ env.packages = ['snf-common', 'snf-app', 'snf-ganeti-tools', 'snf-webproject',
env
.
deb_packages
=
[
'snf-common'
,
'snf-app'
,
'snf-ganeti-tools'
,
'snf-webproject'
]
env
.
capture
=
False
env
.
colors
=
True
env
.
pypi_root
=
'pypi'
env
.
roledefs
=
{
'docs'
:
[
'docs.dev.grnet.gr'
],
'pypi'
:
[
'docs.dev.grnet.gr'
]
}
# coloured logging
notice
=
lambda
x
:
sys
.
stdout
.
write
(
yellow
(
x
)
+
"
\n
"
)
...
...
@@ -83,7 +88,7 @@ def build_pkg(p):
with
lcd
(
package_root
(
p
)):
with
settings
(
warn_only
=
True
):
local
(
"rm -r dist build"
)
local
(
"python setup.py sdist"
)
local
(
"python setup.py
egg_info -d
sdist"
)
def
install_pkg
(
p
):
...
...
@@ -180,3 +185,7 @@ def collectdebs():
for
p
in
env
.
deb_packages
:
local
(
"cp %s/%s*.deb ./packages/"
%
(
build_area
,
p
))
@
roles
(
'pypi'
)
def
uploadtars
():
put
(
"packages/*.tar.gz"
,
'www/pypi/'
)
snf-app/setup.py
View file @
7f9e30fd
...
...
@@ -40,10 +40,16 @@ import os
from
distutils.util
import
convert_path
from
fnmatch
import
fnmatchcase
from
setuptools
import
setup
,
find_packages
from
synnefo.util.version
import
update_version
HERE
=
os
.
path
.
abspath
(
os
.
path
.
normpath
(
os
.
path
.
dirname
(
__file__
)))
update_version
(
'synnefo.versions'
,
'app'
,
HERE
)
try
:
# try to update the version file
from
synnefo.util.version
import
update_version
update_version
(
'synnefo.versions'
,
'app'
,
HERE
)
except
ImportError
:
pass
from
synnefo.versions.app
import
__version__
# Package info
...
...
@@ -68,7 +74,9 @@ INSTALL_REQUIRES = [
'South>=0.7'
,
'pycrypto==2.1.0'
,
'amqplib==0.6.1'
,
'python-daemon==1.5.5'
'python-daemon==1.5.5'
,
'snf-common>=0.7.3'
,
'vncauthproxy>=1.1'
]
EXTRAS_REQUIRES
=
{
...
...
@@ -197,6 +205,8 @@ setup(
extras_require
=
EXTRAS_REQUIRES
,
tests_require
=
TESTS_REQUIRES
,
dependency_links
=
[
'http://docs.dev.grnet.gr/pypi'
],
entry_points
=
{
'console_scripts'
:
[
'snf-dispatcher = synnefo.logic.dispatcher:main'
,
...
...
snf-common/setup.py
View file @
7f9e30fd
...
...
@@ -40,10 +40,16 @@ import os
from
distutils.util
import
convert_path
from
fnmatch
import
fnmatchcase
from
setuptools
import
setup
,
find_packages
from
synnefo.util.version
import
update_version
HERE
=
os
.
path
.
abspath
(
os
.
path
.
normpath
(
os
.
path
.
dirname
(
__file__
)))
update_version
(
'synnefo.versions'
,
'common'
,
HERE
)
try
:
# try to update the version file
from
synnefo.util.version
import
update_version
update_version
(
'synnefo.versions'
,
'common'
,
HERE
)
except
ImportError
:
pass
from
synnefo.versions.common
import
__version__
# Package info
...
...
@@ -91,5 +97,7 @@ setup(
install_requires
=
INSTALL_REQUIRES
,
extras_require
=
EXTRAS_REQUIRES
,
tests_require
=
TESTS_REQUIRES
,
dependency_links
=
[
'http://docs.dev.grnet.gr/pypi'
]
)
snf-common/synnefo/settings/__init__.py
View file @
7f9e30fd
...
...
@@ -38,6 +38,10 @@ import pkg_resources
from
synnefo.util.entry_points
import
extend_settings
# set synnefo package __file__ to fix django related bug
import
synnefo
synnefo
.
__file__
=
os
.
path
.
join
(
synnefo
.
__path__
[
0
],
'__init__.py'
)
# import default settings
from
synnefo.settings.default
import
*
...
...
snf-common/synnefo/util/entry_points.py
View file @
7f9e30fd
...
...
@@ -36,6 +36,8 @@ import pkg_resources
import
inspect
import
types
from
collections
import
defaultdict
import
inspect
def
get_entry_points
(
ns
,
name
):
for
entry_point
in
pkg_resources
.
iter_entry_points
(
group
=
ns
):
...
...
@@ -116,9 +118,19 @@ def extend_list_from_entry_point(settings_object, ns, entry_point_name,
return
settings_object
def
collect_defaults
(
ns
):
settings
=
defaultdict
(
lambda
:
[])
for
e
in
get_entry_points
(
'synnefo'
,
'default_settings'
):
attrs
=
dir
(
e
.
load
())
settings
[
e
.
dist
.
key
]
=
settings
[
e
.
dist
.
key
]
+
attrs
return
settings
def
extend_settings
(
mname
,
ns
):
extend_module_from_entry_point
(
mname
,
ns
)
def
extend_urls
(
patterns
,
ns
):
for
e
in
get_entry_points
(
ns
,
'urls'
):
patterns
+=
e
.
load
()
...
...
snf-common/synnefo/util/version.py
View file @
7f9e30fd
...
...
@@ -57,7 +57,7 @@ def vcs_version():
Package version based on `git describe`, compatible with setuptools
version format
"""
return
vcs_info
()[
3
].
lstrip
(
'v'
)
return
"-"
.
join
(
vcs_info
()[
3
].
lstrip
(
'v'
)
.
split
(
"-"
)[:
-
1
])
def
update_version
(
module
,
name
=
'version'
,
root
=
"."
):
...
...
snf-ganeti-tools/setup.py
View file @
7f9e30fd
#!/usr/bin/env python
# Copyright 2011 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
#
import
os
from
setuptools
import
setup
from
synnefo.util.version
import
update_version
HERE
=
os
.
path
.
abspath
(
os
.
path
.
normpath
(
os
.
path
.
dirname
(
__file__
)))
update_version
(
'synnefo.versions'
,
'ganeti'
,
HERE
)
try
:
# try to update the version file
from
synnefo.util.version
import
update_version
update_version
(
'synnefo.versions'
,
'ganeti'
,
HERE
)
except
ImportError
:
pass
from
synnefo.versions.ganeti
import
__version__
setup
(
...
...
@@ -19,6 +58,7 @@ setup(
url
=
"http://code.grnet.gr/projects/synnefo"
,
namespace_packages
=
[
"synnefo"
,
"synnefo.versions"
],
packages
=
[
"synnefo"
,
"synnefo.ganeti"
,
"synnefo.versions"
],
dependency_links
=
[
'http://docs.dev.grnet.gr/pypi'
],
install_requires
=
[
'daemon'
,
'pyinotify'
,
...
...
snf-okeanos-site/setup.py
View file @
7f9e30fd
# Copyright 2011 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
#
import
distribute_setup
distribute_setup
.
use_setuptools
()
import
os
from
setuptools
import
setup
,
find_packages
from
synnefo.util.version
import
update_version
HERE
=
os
.
path
.
abspath
(
os
.
path
.
normpath
(
os
.
path
.
dirname
(
__file__
)))
update_version
(
'okeanos_site'
,
'version'
,
HERE
)
try
:
# try to update the version file
from
synnefo.util.version
import
update_version
update_version
(
'okeanos_site'
,
'version'
,
HERE
)
except
ImportError
:
pass
from
okeanos_site.version
import
__version__
...
...
@@ -24,6 +64,7 @@ CLASSIFIERS = []
# Package requirements
INSTALL_REQUIRES
=
[
'snf-common>=0.7.3'
,
]
TESTS_REQUIRES
=
[
...
...
@@ -57,6 +98,8 @@ setup(
maintainer
=
'Kostas Papadimitriou'
,
maintainer_email
=
'kpap@grnet.gr'
,
dependency_links
=
[
'http://docs.dev.grnet.gr/pypi'
],
packages
=
PACKAGES
,
package_dir
=
{
''
:
PACKAGES_ROOT
},
include_package_data
=
True
,
...
...
snf-webproject/setup.py
View file @
7f9e30fd
...
...
@@ -40,10 +40,16 @@ import os
from
distutils.util
import
convert_path
from
fnmatch
import
fnmatchcase
from
setuptools
import
setup
,
find_packages
from
synnefo.util.version
import
update_version
HERE
=
os
.
path
.
abspath
(
os
.
path
.
normpath
(
os
.
path
.
dirname
(
__file__
)))
update_version
(
'synnefo.versions'
,
'webproject'
,
HERE
)
try
:
# try to update the version file
from
synnefo.util.version
import
update_version
update_version
(
'synnefo.versions'
,
'webproject'
,
HERE
)
except
ImportError
:
pass
from
synnefo.versions.webproject
import
__version__
# Package info
...
...
@@ -60,7 +66,8 @@ CLASSIFIERS = []
# Package requirements
INSTALL_REQUIRES
=
[
'Django>=1.2.4'
'Django>=1.2.4'
,
'snf-common>=0.7.3'
]
EXTRAS_REQUIRES
=
{
...
...
@@ -93,6 +100,8 @@ setup(
extras_require
=
EXTRAS_REQUIRES
,
tests_require
=
TESTS_REQUIRES
,
dependency_links
=
[
'http://docs.dev.grnet.gr/pypi'
],
entry_points
=
{
'console_scripts'
:
[
'snf-manage = synnefo.webproject.manage:main'
,
...
...
snf-webproject/synnefo/webproject/manage.py
View file @
7f9e30fd
...
...
@@ -36,6 +36,7 @@ def find_modules(name, path=None):
Unlike find_module in the imp package this returns a list of all
matched modules.
"""
results
=
[]
if
path
is
None
:
path
=
sys
.
path
for
p
in
path
:
...
...
@@ -50,9 +51,19 @@ def find_modules(name, path=None):
if
result
is
not
None
:
results
.
append
(
result
)
except
ImportError
:
if
sys
.
modules
.
get
(
name
,
None
):
modpath
=
sys
.
modules
[
name
].
__path__
if
isinstance
(
modpath
,
basestring
)
and
not
(
''
,
modpath
)
in
results
:
results
.
append
((
''
,
sys
.
modules
[
name
].
__path__
))
else
:
for
mp
in
modpath
:
if
not
(
''
,
mp
)
in
results
:
results
.
append
((
''
,
mp
))
pass
if
not
results
:
raise
ImportError
(
"No module named %.200s"
%
name
)
return
results
def
find_management_module
(
app_name
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment