Show More
1 | NO CONTENT: new file 100644 |
|
NO CONTENT: new file 100644 |
@@ -0,0 +1,43 b'' | |||||
|
1 | # -*- coding: utf-8 -*- | |||
|
2 | ||||
|
3 | # Copyright (C) 2013-2017 RhodeCode GmbH | |||
|
4 | # | |||
|
5 | # This program is free software: you can redistribute it and/or modify | |||
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |||
|
7 | # (only), as published by the Free Software Foundation. | |||
|
8 | # | |||
|
9 | # This program is distributed in the hope that it will be useful, | |||
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
|
12 | # GNU General Public License for more details. | |||
|
13 | # | |||
|
14 | # You should have received a copy of the GNU Affero General Public License | |||
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
|
16 | # | |||
|
17 | # This program is dual-licensed. If you wish to learn more about the | |||
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |||
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |||
|
20 | ||||
|
21 | ||||
|
22 | from rhodecode.lib.paster_commands import BasePasterCommand | |||
|
23 | ||||
|
24 | ||||
|
25 | class Command(BasePasterCommand): | |||
|
26 | """ | |||
|
27 | Start the celery worker | |||
|
28 | ||||
|
29 | Starts the celery worker that uses a paste.deploy configuration | |||
|
30 | file. | |||
|
31 | """ | |||
|
32 | usage = 'CONFIG_FILE [celeryd options...]' | |||
|
33 | summary = __doc__.splitlines()[0] | |||
|
34 | description = "".join(__doc__.splitlines()[2:]) | |||
|
35 | ||||
|
36 | parser = BasePasterCommand.standard_parser(quiet=True) | |||
|
37 | ||||
|
38 | def update_parser(self): | |||
|
39 | pass | |||
|
40 | ||||
|
41 | def command(self): | |||
|
42 | cmd = 'celery worker --beat --app rhodecode.lib.celerylib.loader --loglevel DEBUG --ini=%s' % self.path_to_ini_file | |||
|
43 | raise Exception('This Command is deprecated please run: %s' % cmd) No newline at end of file |
@@ -1,19 +1,90 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2010-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2010-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
|
20 | import os | |||
|
21 | import logging | |||
|
22 | ||||
|
23 | from paste.script.command import Command, BadCommand | |||
|
24 | ||||
|
25 | ||||
|
26 | class BasePasterCommand(Command): | |||
|
27 | """ | |||
|
28 | Abstract Base Class for paster commands. | |||
|
29 | ||||
|
30 | The celery commands are somewhat aggressive about loading | |||
|
31 | celery.conf, and since our module sets the `CELERY_LOADER` | |||
|
32 | environment variable to our loader, we have to bootstrap a bit and | |||
|
33 | make sure we've had a chance to load the pylons config off of the | |||
|
34 | command line, otherwise everything fails. | |||
|
35 | """ | |||
|
36 | min_args = 1 | |||
|
37 | min_args_error = "Please provide a paster config file as an argument." | |||
|
38 | takes_config_file = 1 | |||
|
39 | requires_config_file = True | |||
|
40 | ||||
|
41 | def notify_msg(self, msg, log=False): | |||
|
42 | """Make a notification to user, additionally if logger is passed | |||
|
43 | it logs this action using given logger | |||
|
44 | ||||
|
45 | :param msg: message that will be printed to user | |||
|
46 | :param log: logging instance, to use to additionally log this message | |||
|
47 | ||||
|
48 | """ | |||
|
49 | if log and isinstance(log, logging): | |||
|
50 | log(msg) | |||
|
51 | ||||
|
52 | def run(self, args): | |||
|
53 | """ | |||
|
54 | Overrides Command.run | |||
|
55 | ||||
|
56 | Checks for a config file argument and loads it. | |||
|
57 | """ | |||
|
58 | if len(args) < self.min_args: | |||
|
59 | raise BadCommand( | |||
|
60 | self.min_args_error % {'min_args': self.min_args, | |||
|
61 | 'actual_args': len(args)}) | |||
|
62 | ||||
|
63 | # Decrement because we're going to lob off the first argument. | |||
|
64 | # @@ This is hacky | |||
|
65 | self.min_args -= 1 | |||
|
66 | self.bootstrap_config(args[0]) | |||
|
67 | self.update_parser() | |||
|
68 | return super(BasePasterCommand, self).run(args[1:]) | |||
|
69 | ||||
|
70 | def update_parser(self): | |||
|
71 | """ | |||
|
72 | Abstract method. Allows for the class' parser to be updated | |||
|
73 | before the superclass' `run` method is called. Necessary to | |||
|
74 | allow options/arguments to be passed through to the underlying | |||
|
75 | celery command. | |||
|
76 | """ | |||
|
77 | raise NotImplementedError("Abstract Method.") | |||
|
78 | ||||
|
79 | def bootstrap_config(self, conf): | |||
|
80 | """ | |||
|
81 | Loads the pylons configuration. | |||
|
82 | """ | |||
|
83 | self.path_to_ini_file = os.path.realpath(conf) | |||
|
84 | ||||
|
85 | def _init_session(self): | |||
|
86 | """ | |||
|
87 | Inits SqlAlchemy Session | |||
|
88 | """ | |||
|
89 | logging.config.fileConfig(self.path_to_ini_file) | |||
|
90 |
@@ -1,65 +1,64 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2013-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2013-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 | """ |
|
21 | """ | |
22 | deprecated make-config paster command for RhodeCode |
|
22 | deprecated make-config paster command for RhodeCode | |
23 | """ |
|
23 | """ | |
24 |
|
24 | |||
25 | import os |
|
25 | import os | |
26 | import sys |
|
26 | import sys | |
27 | from paste.script.appinstall import AbstractInstallCommand |
|
27 | from paste.script.appinstall import AbstractInstallCommand | |
28 | from paste.script.command import BadCommand |
|
|||
29 | from paste.deploy import appconfig |
|
|||
30 |
|
28 | |||
31 | # fix rhodecode import |
|
29 | # fix rhodecode import | |
32 | from os.path import dirname as dn |
|
30 | from os.path import dirname as dn | |
33 | rc_path = dn(dn(dn(os.path.realpath(__file__)))) |
|
31 | rc_path = dn(dn(dn(os.path.realpath(__file__)))) | |
34 | sys.path.append(rc_path) |
|
32 | sys.path.append(rc_path) | |
35 |
|
33 | |||
|
34 | ||||
36 | class Command(AbstractInstallCommand): |
|
35 | class Command(AbstractInstallCommand): | |
37 |
|
36 | |||
38 | default_verbosity = 1 |
|
37 | default_verbosity = 1 | |
39 | max_args = None |
|
38 | max_args = None | |
40 | min_args = 1 |
|
39 | min_args = 1 | |
41 | summary = "*DEPRECATED* Install a package and create a fresh config file/directory" |
|
40 | summary = "*DEPRECATED* Install a package and create a fresh config file/directory" | |
42 | usage = "PACKAGE_NAME [CONFIG_FILE] [VAR=VALUE]" |
|
41 | usage = "PACKAGE_NAME [CONFIG_FILE] [VAR=VALUE]" | |
43 |
|
42 | |||
44 | description = """\ |
|
43 | description = """\ | |
45 | Note: this is an experimental command, and it will probably change |
|
44 | Note: this is an experimental command, and it will probably change | |
46 | in several ways by the next release. |
|
45 | in several ways by the next release. | |
47 |
|
46 | |||
48 | make-config is part of a two-phase installation process (the |
|
47 | make-config is part of a two-phase installation process (the | |
49 | second phase is setup-app). make-config installs the package |
|
48 | second phase is setup-app). make-config installs the package | |
50 | (using easy_install) and asks it to create a bare configuration |
|
49 | (using easy_install) and asks it to create a bare configuration | |
51 | file or directory (possibly filling in defaults from the extra |
|
50 | file or directory (possibly filling in defaults from the extra | |
52 | variables you give). |
|
51 | variables you give). | |
53 | """ |
|
52 | """ | |
54 |
|
53 | |||
55 | parser = AbstractInstallCommand.standard_parser( |
|
54 | parser = AbstractInstallCommand.standard_parser( | |
56 | simulate=True, quiet=True, no_interactive=True) |
|
55 | simulate=True, quiet=True, no_interactive=True) | |
57 |
|
56 | |||
58 | def command(self): |
|
57 | def command(self): | |
59 | sys.stderr.write( |
|
58 | sys.stderr.write( | |
60 | '** Warning **\n' |
|
59 | '** Warning **\n' | |
61 | 'This command is now removed and depracated, please ' |
|
60 | 'This command is now removed and depracated, please ' | |
62 | 'use new rhodecode-config command instead.') |
|
61 | 'use new rhodecode-config command instead.') | |
63 | sys.exit(-1) |
|
62 | sys.exit(-1) | |
64 | def update_parser(self): |
|
63 | def update_parser(self): | |
65 | pass |
|
64 | pass |
@@ -1,80 +1,80 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2013-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2013-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 | """ |
|
21 | """ | |
22 | interactive shell paster command for RhodeCode |
|
22 | interactive shell paster command for RhodeCode | |
23 | """ |
|
23 | """ | |
24 |
|
24 | |||
25 | import os |
|
25 | import os | |
26 | import sys |
|
26 | import sys | |
27 | import logging |
|
27 | import logging | |
28 |
|
28 | |||
29 |
from rhodecode.lib. |
|
29 | from rhodecode.lib.paster_commands import BasePasterCommand | |
30 |
|
30 | |||
31 | # fix rhodecode import |
|
31 | # fix rhodecode import | |
32 | from os.path import dirname as dn |
|
32 | from os.path import dirname as dn | |
33 | rc_path = dn(dn(dn(os.path.realpath(__file__)))) |
|
33 | rc_path = dn(dn(dn(os.path.realpath(__file__)))) | |
34 | sys.path.append(rc_path) |
|
34 | sys.path.append(rc_path) | |
35 |
|
35 | |||
36 | log = logging.getLogger(__name__) |
|
36 | log = logging.getLogger(__name__) | |
37 |
|
37 | |||
38 | welcome_banner = """Welcome to RhodeCode iShell. |
|
38 | welcome_banner = """Welcome to RhodeCode iShell. | |
39 | Type `exit` to exit the shell. |
|
39 | Type `exit` to exit the shell. | |
40 | iShell is interactive shell to interact directly with the |
|
40 | iShell is interactive shell to interact directly with the | |
41 | internal RhodeCode APIs. You can rescue your lost password, |
|
41 | internal RhodeCode APIs. You can rescue your lost password, | |
42 | or reset some user/system settings. |
|
42 | or reset some user/system settings. | |
43 | """ |
|
43 | """ | |
44 |
|
44 | |||
45 |
|
45 | |||
46 | class Command(BasePasterCommand): |
|
46 | class Command(BasePasterCommand): | |
47 |
|
47 | |||
48 | max_args = 1 |
|
48 | max_args = 1 | |
49 | min_args = 1 |
|
49 | min_args = 1 | |
50 |
|
50 | |||
51 | usage = "CONFIG_FILE" |
|
51 | usage = "CONFIG_FILE" | |
52 | group_name = "RhodeCode" |
|
52 | group_name = "RhodeCode" | |
53 | takes_config_file = -1 |
|
53 | takes_config_file = -1 | |
54 | parser = BasePasterCommand.standard_parser(verbose=True) |
|
54 | parser = BasePasterCommand.standard_parser(verbose=True) | |
55 | summary = "Interactive shell" |
|
55 | summary = "Interactive shell" | |
56 |
|
56 | |||
57 | def command(self): |
|
57 | def command(self): | |
58 | #get SqlAlchemy session |
|
58 | #get SqlAlchemy session | |
59 | self._init_session() |
|
59 | self._init_session() | |
60 |
|
60 | |||
61 | # imports, used in ipython shell |
|
61 | # imports, used in ipython shell | |
62 | import os |
|
62 | import os | |
63 | import sys |
|
63 | import sys | |
64 | import time |
|
64 | import time | |
65 | import shutil |
|
65 | import shutil | |
66 | import datetime |
|
66 | import datetime | |
67 | from rhodecode.model.db import * |
|
67 | from rhodecode.model.db import * | |
68 |
|
68 | |||
69 | try: |
|
69 | try: | |
70 | from IPython import embed |
|
70 | from IPython import embed | |
71 | from traitlets.config import Config |
|
71 | from traitlets.config import Config | |
72 | cfg = Config() |
|
72 | cfg = Config() | |
73 | cfg.InteractiveShellEmbed.confirm_exit = False |
|
73 | cfg.InteractiveShellEmbed.confirm_exit = False | |
74 | embed(config=cfg, banner1=welcome_banner) |
|
74 | embed(config=cfg, banner1=welcome_banner) | |
75 | except ImportError: |
|
75 | except ImportError: | |
76 | print('ipython installation required for ishell') |
|
76 | print('ipython installation required for ishell') | |
77 | sys.exit(-1) |
|
77 | sys.exit(-1) | |
78 |
|
78 | |||
79 | def update_parser(self): |
|
79 | def update_parser(self): | |
80 | pass |
|
80 | pass |
@@ -1,183 +1,184 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Copyright (C) 2010-2017 RhodeCode GmbH |
|
3 | # Copyright (C) 2010-2017 RhodeCode GmbH | |
4 | # |
|
4 | # | |
5 | # This program is free software: you can redistribute it and/or modify |
|
5 | # This program is free software: you can redistribute it and/or modify | |
6 | # it under the terms of the GNU Affero General Public License, version 3 |
|
6 | # it under the terms of the GNU Affero General Public License, version 3 | |
7 | # (only), as published by the Free Software Foundation. |
|
7 | # (only), as published by the Free Software Foundation. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU Affero General Public License |
|
14 | # You should have received a copy of the GNU Affero General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | # |
|
16 | # | |
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
21 | # Import early to make sure things are patched up properly |
|
21 | # Import early to make sure things are patched up properly | |
22 | from setuptools import setup, find_packages |
|
22 | from setuptools import setup, find_packages | |
23 |
|
23 | |||
24 | import os |
|
24 | import os | |
25 | import sys |
|
25 | import sys | |
26 | import pkgutil |
|
26 | import pkgutil | |
27 | import platform |
|
27 | import platform | |
28 |
|
28 | |||
29 | from pip.download import PipSession |
|
29 | from pip.download import PipSession | |
30 | from pip.req import parse_requirements |
|
30 | from pip.req import parse_requirements | |
31 |
|
31 | |||
32 | from codecs import open |
|
32 | from codecs import open | |
33 |
|
33 | |||
34 |
|
34 | |||
35 | if sys.version_info < (2, 7): |
|
35 | if sys.version_info < (2, 7): | |
36 | raise Exception('RhodeCode requires Python 2.7 or later') |
|
36 | raise Exception('RhodeCode requires Python 2.7 or later') | |
37 |
|
37 | |||
38 | here = os.path.abspath(os.path.dirname(__file__)) |
|
38 | here = os.path.abspath(os.path.dirname(__file__)) | |
39 |
|
39 | |||
40 | # defines current platform |
|
40 | # defines current platform | |
41 | __platform__ = platform.system() |
|
41 | __platform__ = platform.system() | |
42 | __license__ = 'AGPLv3, and Commercial License' |
|
42 | __license__ = 'AGPLv3, and Commercial License' | |
43 | __author__ = 'RhodeCode GmbH' |
|
43 | __author__ = 'RhodeCode GmbH' | |
44 | __url__ = 'https://code.rhodecode.com' |
|
44 | __url__ = 'https://code.rhodecode.com' | |
45 | is_windows = __platform__ in ('Windows',) |
|
45 | is_windows = __platform__ in ('Windows',) | |
46 |
|
46 | |||
47 |
|
47 | |||
48 | def _get_requirements(req_filename, exclude=None, extras=None): |
|
48 | def _get_requirements(req_filename, exclude=None, extras=None): | |
49 | extras = extras or [] |
|
49 | extras = extras or [] | |
50 | exclude = exclude or [] |
|
50 | exclude = exclude or [] | |
51 |
|
51 | |||
52 | try: |
|
52 | try: | |
53 | parsed = parse_requirements( |
|
53 | parsed = parse_requirements( | |
54 | os.path.join(here, req_filename), session=PipSession()) |
|
54 | os.path.join(here, req_filename), session=PipSession()) | |
55 | except TypeError: |
|
55 | except TypeError: | |
56 | # try pip < 6.0.0, that doesn't support session |
|
56 | # try pip < 6.0.0, that doesn't support session | |
57 | parsed = parse_requirements(os.path.join(here, req_filename)) |
|
57 | parsed = parse_requirements(os.path.join(here, req_filename)) | |
58 |
|
58 | |||
59 | requirements = [] |
|
59 | requirements = [] | |
60 | for ir in parsed: |
|
60 | for ir in parsed: | |
61 | if ir.req and ir.name not in exclude: |
|
61 | if ir.req and ir.name not in exclude: | |
62 | requirements.append(str(ir.req)) |
|
62 | requirements.append(str(ir.req)) | |
63 | return requirements + extras |
|
63 | return requirements + extras | |
64 |
|
64 | |||
65 |
|
65 | |||
66 | # requirements extract |
|
66 | # requirements extract | |
67 | setup_requirements = ['PasteScript', 'pytest-runner'] |
|
67 | setup_requirements = ['PasteScript', 'pytest-runner'] | |
68 | install_requirements = _get_requirements( |
|
68 | install_requirements = _get_requirements( | |
69 | 'requirements.txt', exclude=['setuptools', 'entrypoints']) |
|
69 | 'requirements.txt', exclude=['setuptools', 'entrypoints']) | |
70 | test_requirements = _get_requirements( |
|
70 | test_requirements = _get_requirements( | |
71 | 'requirements_test.txt', extras=['configobj']) |
|
71 | 'requirements_test.txt', extras=['configobj']) | |
72 |
|
72 | |||
73 |
|
73 | |||
74 | def get_version(): |
|
74 | def get_version(): | |
75 | version = pkgutil.get_data('rhodecode', 'VERSION') |
|
75 | version = pkgutil.get_data('rhodecode', 'VERSION') | |
76 | return version.strip() |
|
76 | return version.strip() | |
77 |
|
77 | |||
78 |
|
78 | |||
79 | # additional files that goes into package itself |
|
79 | # additional files that goes into package itself | |
80 | package_data = { |
|
80 | package_data = { | |
81 | '': ['*.txt', '*.rst'], |
|
81 | '': ['*.txt', '*.rst'], | |
82 | 'configs': ['*.ini'], |
|
82 | 'configs': ['*.ini'], | |
83 | 'rhodecode': ['VERSION', 'i18n/*/LC_MESSAGES/*.mo', ], |
|
83 | 'rhodecode': ['VERSION', 'i18n/*/LC_MESSAGES/*.mo', ], | |
84 | } |
|
84 | } | |
85 |
|
85 | |||
86 | description = 'Source Code Management Platform' |
|
86 | description = 'Source Code Management Platform' | |
87 | keywords = ' '.join([ |
|
87 | keywords = ' '.join([ | |
88 | 'rhodecode', 'mercurial', 'git', 'svn', |
|
88 | 'rhodecode', 'mercurial', 'git', 'svn', | |
89 | 'code review', |
|
89 | 'code review', | |
90 | 'repo groups', 'ldap', 'repository management', 'hgweb', |
|
90 | 'repo groups', 'ldap', 'repository management', 'hgweb', | |
91 | 'hgwebdir', 'gitweb', 'serving hgweb', |
|
91 | 'hgwebdir', 'gitweb', 'serving hgweb', | |
92 | ]) |
|
92 | ]) | |
93 |
|
93 | |||
94 |
|
94 | |||
95 | # README/DESCRIPTION generation |
|
95 | # README/DESCRIPTION generation | |
96 | readme_file = 'README.rst' |
|
96 | readme_file = 'README.rst' | |
97 | changelog_file = 'CHANGES.rst' |
|
97 | changelog_file = 'CHANGES.rst' | |
98 | try: |
|
98 | try: | |
99 | long_description = open(readme_file).read() + '\n\n' + \ |
|
99 | long_description = open(readme_file).read() + '\n\n' + \ | |
100 | open(changelog_file).read() |
|
100 | open(changelog_file).read() | |
101 | except IOError as err: |
|
101 | except IOError as err: | |
102 | sys.stderr.write( |
|
102 | sys.stderr.write( | |
103 | "[WARNING] Cannot find file specified as long_description (%s)\n " |
|
103 | "[WARNING] Cannot find file specified as long_description (%s)\n " | |
104 | "or changelog (%s) skipping that file" % (readme_file, changelog_file)) |
|
104 | "or changelog (%s) skipping that file" % (readme_file, changelog_file)) | |
105 | long_description = description |
|
105 | long_description = description | |
106 |
|
106 | |||
107 |
|
107 | |||
108 | setup( |
|
108 | setup( | |
109 | name='rhodecode-enterprise-ce', |
|
109 | name='rhodecode-enterprise-ce', | |
110 | version=get_version(), |
|
110 | version=get_version(), | |
111 | description=description, |
|
111 | description=description, | |
112 | long_description=long_description, |
|
112 | long_description=long_description, | |
113 | keywords=keywords, |
|
113 | keywords=keywords, | |
114 | license=__license__, |
|
114 | license=__license__, | |
115 | author=__author__, |
|
115 | author=__author__, | |
116 | author_email='marcin@rhodecode.com', |
|
116 | author_email='marcin@rhodecode.com', | |
117 | url=__url__, |
|
117 | url=__url__, | |
118 | setup_requires=setup_requirements, |
|
118 | setup_requires=setup_requirements, | |
119 | install_requires=install_requirements, |
|
119 | install_requires=install_requirements, | |
120 | tests_require=test_requirements, |
|
120 | tests_require=test_requirements, | |
121 | zip_safe=False, |
|
121 | zip_safe=False, | |
122 | packages=find_packages(exclude=["docs", "tests*"]), |
|
122 | packages=find_packages(exclude=["docs", "tests*"]), | |
123 | package_data=package_data, |
|
123 | package_data=package_data, | |
124 | include_package_data=True, |
|
124 | include_package_data=True, | |
125 | classifiers=[ |
|
125 | classifiers=[ | |
126 | 'Development Status :: 6 - Mature', |
|
126 | 'Development Status :: 6 - Mature', | |
127 | 'Environment :: Web Environment', |
|
127 | 'Environment :: Web Environment', | |
128 | 'Intended Audience :: Developers', |
|
128 | 'Intended Audience :: Developers', | |
129 | 'Operating System :: OS Independent', |
|
129 | 'Operating System :: OS Independent', | |
130 | 'Topic :: Software Development :: Version Control', |
|
130 | 'Topic :: Software Development :: Version Control', | |
131 | 'License :: OSI Approved :: Affero GNU General Public License v3 or later (AGPLv3+)', |
|
131 | 'License :: OSI Approved :: Affero GNU General Public License v3 or later (AGPLv3+)', | |
132 | 'Programming Language :: Python :: 2.7', |
|
132 | 'Programming Language :: Python :: 2.7', | |
133 | ], |
|
133 | ], | |
134 | message_extractors={ |
|
134 | message_extractors={ | |
135 | 'rhodecode': [ |
|
135 | 'rhodecode': [ | |
136 | ('**.py', 'python', None), |
|
136 | ('**.py', 'python', None), | |
137 | ('**.js', 'javascript', None), |
|
137 | ('**.js', 'javascript', None), | |
138 | ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), |
|
138 | ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), | |
139 | ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}), |
|
139 | ('templates/**.html', 'mako', {'input_encoding': 'utf-8'}), | |
140 | ('public/**', 'ignore', None), |
|
140 | ('public/**', 'ignore', None), | |
141 | ] |
|
141 | ] | |
142 | }, |
|
142 | }, | |
143 | paster_plugins=['PasteScript'], |
|
143 | paster_plugins=['PasteScript'], | |
144 | entry_points={ |
|
144 | entry_points={ | |
145 | 'enterprise.plugins1': [ |
|
145 | 'enterprise.plugins1': [ | |
146 | 'crowd=rhodecode.authentication.plugins.auth_crowd:plugin_factory', |
|
146 | 'crowd=rhodecode.authentication.plugins.auth_crowd:plugin_factory', | |
147 | 'headers=rhodecode.authentication.plugins.auth_headers:plugin_factory', |
|
147 | 'headers=rhodecode.authentication.plugins.auth_headers:plugin_factory', | |
148 | 'jasig_cas=rhodecode.authentication.plugins.auth_jasig_cas:plugin_factory', |
|
148 | 'jasig_cas=rhodecode.authentication.plugins.auth_jasig_cas:plugin_factory', | |
149 | 'ldap=rhodecode.authentication.plugins.auth_ldap:plugin_factory', |
|
149 | 'ldap=rhodecode.authentication.plugins.auth_ldap:plugin_factory', | |
150 | 'pam=rhodecode.authentication.plugins.auth_pam:plugin_factory', |
|
150 | 'pam=rhodecode.authentication.plugins.auth_pam:plugin_factory', | |
151 | 'rhodecode=rhodecode.authentication.plugins.auth_rhodecode:plugin_factory', |
|
151 | 'rhodecode=rhodecode.authentication.plugins.auth_rhodecode:plugin_factory', | |
152 | 'token=rhodecode.authentication.plugins.auth_token:plugin_factory', |
|
152 | 'token=rhodecode.authentication.plugins.auth_token:plugin_factory', | |
153 | ], |
|
153 | ], | |
154 | 'paste.app_factory': [ |
|
154 | 'paste.app_factory': [ | |
155 | 'main=rhodecode.config.middleware:make_pyramid_app', |
|
155 | 'main=rhodecode.config.middleware:make_pyramid_app', | |
156 | ], |
|
156 | ], | |
157 | 'paste.global_paster_command': [ |
|
157 | 'paste.global_paster_command': [ | |
158 | 'make-config=rhodecode.lib.paster_commands.make_config:Command', |
|
|||
159 | 'setup-rhodecode=rhodecode.lib.paster_commands.setup_rhodecode:Command', |
|
158 | 'setup-rhodecode=rhodecode.lib.paster_commands.setup_rhodecode:Command', | |
160 | 'ishell=rhodecode.lib.paster_commands.ishell:Command', |
|
159 | 'ishell=rhodecode.lib.paster_commands.ishell:Command', | |
161 | 'upgrade-db=rhodecode.lib.dbmigrate:UpgradeDb', |
|
160 | 'upgrade-db=rhodecode.lib.dbmigrate:UpgradeDb', | |
162 | 'celeryd=rhodecode.lib.celerypylons.commands:CeleryDaemonCommand', |
|
161 | ||
|
162 | 'make-config=rhodecode.lib.paster_commands.make_config:Command', | |||
|
163 | 'celeryd=rhodecode.lib.paster_commands.deprecated.celeryd:Command', | |||
163 | ], |
|
164 | ], | |
164 | 'pyramid.pshell_runner': [ |
|
165 | 'pyramid.pshell_runner': [ | |
165 | 'ipython = rhodecode.lib.pyramid_shell:ipython_shell_runner', |
|
166 | 'ipython = rhodecode.lib.pyramid_shell:ipython_shell_runner', | |
166 | ], |
|
167 | ], | |
167 | 'pytest11': [ |
|
168 | 'pytest11': [ | |
168 | 'pylons=rhodecode.tests.pylons_plugin', |
|
169 | 'pylons=rhodecode.tests.pylons_plugin', | |
169 | 'enterprise=rhodecode.tests.plugin', |
|
170 | 'enterprise=rhodecode.tests.plugin', | |
170 | ], |
|
171 | ], | |
171 | 'console_scripts': [ |
|
172 | 'console_scripts': [ | |
172 | 'rc-server=rhodecode.rcserver:main', |
|
173 | 'rc-server=rhodecode.rcserver:main', | |
173 | 'rc-setup-app=rhodecode.lib.rc_commands.setup_rc:main', |
|
174 | 'rc-setup-app=rhodecode.lib.rc_commands.setup_rc:main', | |
174 | 'rc-upgrade-db=rhodecode.lib.rc_commands.upgrade_db:main', |
|
175 | 'rc-upgrade-db=rhodecode.lib.rc_commands.upgrade_db:main', | |
175 | 'rc-ishell=rhodecode.lib.rc_commands.ishell:main', |
|
176 | 'rc-ishell=rhodecode.lib.rc_commands.ishell:main', | |
176 | 'rc-ssh-wrapper=rhodecode.apps.ssh_support.lib.ssh_wrapper:main', |
|
177 | 'rc-ssh-wrapper=rhodecode.apps.ssh_support.lib.ssh_wrapper:main', | |
177 | ], |
|
178 | ], | |
178 | 'beaker.backends': [ |
|
179 | 'beaker.backends': [ | |
179 | 'memorylru_base=rhodecode.lib.memory_lru_debug:MemoryLRUNamespaceManagerBase', |
|
180 | 'memorylru_base=rhodecode.lib.memory_lru_debug:MemoryLRUNamespaceManagerBase', | |
180 | 'memorylru_debug=rhodecode.lib.memory_lru_debug:MemoryLRUNamespaceManagerDebug' |
|
181 | 'memorylru_debug=rhodecode.lib.memory_lru_debug:MemoryLRUNamespaceManagerDebug' | |
181 | ] |
|
182 | ] | |
182 | }, |
|
183 | }, | |
183 | ) |
|
184 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now