##// END OF EJS Templates
python3: use minimal 3.10 version
super-admin -
r1055:c4d2b190 python3
parent child Browse files
Show More
@@ -1,43 +1,42 b''
1 ## dependencies
1 ## dependencies
2
2
3 # our custom configobj
4 configobj==5.0.8
3 configobj==5.0.8
5
4
6 dogpile.cache==1.1.8
5 dogpile.cache==1.1.8
7
6
8 decorator==5.1.1
7 decorator==5.1.1
9 dulwich==0.21.3
8 dulwich==0.21.3
10 hg-evolve==11.0.0
9 hg-evolve==11.0.0
11
10
12 mercurial==6.3.3
11 mercurial==6.3.3
13 msgpack-python==0.5.6
12 msgpack-python==0.5.6
14 more-itertools==9.1.0
13 more-itertools==9.1.0
15
14
16 pastedeploy==3.0.1
15 pastedeploy==3.0.1
17 pyramid==2.0.1
16 pyramid==2.0.1
18 pygit2==1.11.1
17 pygit2==1.11.1
19
18
20 repoze.lru==0.7
19 repoze.lru==0.7
21 redis==4.5.1
20 redis==4.5.1
22 simplejson==3.18.3
21 simplejson==3.18.3
23 subvertpy==0.11.0
22 subvertpy==0.11.0
24
23
25 translationstring==1.4
24 translationstring==1.4
26 webob==1.8.7
25 webob==1.8.7
27 zope.deprecation==4.4.0
26 zope.deprecation==4.4.0
28 zope.interface==5.5.2
27 zope.interface==5.5.2
29
28
30 ## http servers
29 ## http servers
31 #gevent==20.6.0
30 #gevent==20.6.0
32 #greenlet==0.4.16
31 #greenlet==0.4.16
33 gunicorn==20.1.0
32 gunicorn==20.1.0
34 waitress==2.1.2
33 waitress==2.1.2
35
34
36 ## test related requirements
35 ## test related requirements
37 -r requirements_test.txt
36 -r requirements_test.txt
38
37
39 ## uncomment to add the debug libraries
38 ## uncomment to add the debug libraries
40 #ipdb==0.13.2
39 #ipdb==0.13.2
41 #ipython==7.15.0
40 #ipython==7.15.0
42
41
43 #-r requirements_debug.txt
42 #-r requirements_debug.txt
@@ -1,163 +1,163 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 # RhodeCode VCSServer provides access to different vcs backends via network.
3 # RhodeCode VCSServer provides access to different vcs backends via network.
4 # Copyright (C) 2014-2019 RodeCode GmbH
4 # Copyright (C) 2014-2019 RodeCode GmbH
5 #
5 #
6 # This program is free software; you can redistribute it and/or modify
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
9 # (at your option) any later version.
10 #
10 #
11 # This program is distributed in the hope that it will be useful,
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
14 # GNU General Public License for more details.
15 #
15 #
16 # You should have received a copy of the GNU General Public License
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software Foundation,
17 # along with this program; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
19
20 # Import early to make sure things are patched up properly
20 # Import early to make sure things are patched up properly
21 from setuptools import setup, find_packages
21 from setuptools import setup, find_packages
22
22
23 import os
23 import os
24 import re
24 import re
25 import sys
25 import sys
26 import pkgutil
26 import pkgutil
27 import platform
27 import platform
28 import codecs
28 import codecs
29
29
30 import pip
30 import pip
31
31
32 pip_major_version = int(pip.__version__.split(".")[0])
32 pip_major_version = int(pip.__version__.split(".")[0])
33 if pip_major_version >= 20:
33 if pip_major_version >= 20:
34 from pip._internal.req import parse_requirements
34 from pip._internal.req import parse_requirements
35 from pip._internal.network.session import PipSession
35 from pip._internal.network.session import PipSession
36 elif pip_major_version >= 10:
36 elif pip_major_version >= 10:
37 from pip._internal.req import parse_requirements
37 from pip._internal.req import parse_requirements
38 from pip._internal.download import PipSession
38 from pip._internal.download import PipSession
39 else:
39 else:
40 from pip.req import parse_requirements
40 from pip.req import parse_requirements
41 from pip.download import PipSession
41 from pip.download import PipSession
42
42
43
43
44 def get_package_name(req_object):
44 def get_package_name(req_object):
45 package_name = None
45 package_name = None
46 try:
46 try:
47 from pip._internal.req.constructors import install_req_from_parsed_requirement
47 from pip._internal.req.constructors import install_req_from_parsed_requirement
48 except ImportError:
48 except ImportError:
49 install_req_from_parsed_requirement = None
49 install_req_from_parsed_requirement = None
50
50
51 # In 20.1 of pip, the requirements object changed
51 # In 20.1 of pip, the requirements object changed
52 if hasattr(req_object, 'req'):
52 if hasattr(req_object, 'req'):
53 package_name = req_object.req.name
53 package_name = req_object.req.name
54
54
55 if package_name is None:
55 if package_name is None:
56 if install_req_from_parsed_requirement:
56 if install_req_from_parsed_requirement:
57 package = install_req_from_parsed_requirement(req_object)
57 package = install_req_from_parsed_requirement(req_object)
58 package_name = package.req.name
58 package_name = package.req.name
59
59
60 if package_name is None:
60 if package_name is None:
61 # fallback for older pip
61 # fallback for older pip
62 package_name = re.split('===|<=|!=|==|>=|~=|<|>', req_object.requirement)[0]
62 package_name = re.split('===|<=|!=|==|>=|~=|<|>', req_object.requirement)[0]
63
63
64 return package_name
64 return package_name
65
65
66
66
67 if sys.version_info < (2, 7):
67 if sys.version_info < (3, 10):
68 raise Exception('VCSServer requires Python 2.7 or later')
68 raise Exception('RhodeCode requires Python 3.10 or later')
69
69
70 here = os.path.abspath(os.path.dirname(__file__))
70 here = os.path.abspath(os.path.dirname(__file__))
71
71
72 # defines current platform
72 # defines current platform
73 __platform__ = platform.system()
73 __platform__ = platform.system()
74 __license__ = 'GPL V3'
74 __license__ = 'GPL V3'
75 __author__ = 'RhodeCode GmbH'
75 __author__ = 'RhodeCode GmbH'
76 __url__ = 'https://code.rhodecode.com'
76 __url__ = 'https://code.rhodecode.com'
77 is_windows = __platform__ in ('Windows',)
77 is_windows = __platform__ in ('Windows',)
78
78
79
79
80 def _get_requirements(req_filename, exclude=None, extras=None):
80 def _get_requirements(req_filename, exclude=None, extras=None):
81 extras = extras or []
81 extras = extras or []
82 exclude = exclude or []
82 exclude = exclude or []
83
83
84 try:
84 try:
85 parsed = parse_requirements(
85 parsed = parse_requirements(
86 os.path.join(here, req_filename), session=PipSession())
86 os.path.join(here, req_filename), session=PipSession())
87 except TypeError:
87 except TypeError:
88 # try pip < 6.0.0, that doesn't support session
88 # try pip < 6.0.0, that doesn't support session
89 parsed = parse_requirements(os.path.join(here, req_filename))
89 parsed = parse_requirements(os.path.join(here, req_filename))
90
90
91 requirements = []
91 requirements = []
92 for int_req in parsed:
92 for int_req in parsed:
93 req_name = get_package_name(int_req)
93 req_name = get_package_name(int_req)
94 if req_name not in exclude:
94 if req_name not in exclude:
95 requirements.append(req_name)
95 requirements.append(req_name)
96 return requirements + extras
96 return requirements + extras
97
97
98
98
99 # requirements extract
99 # requirements extract
100 setup_requirements = []
100 setup_requirements = []
101 install_requirements = _get_requirements(
101 install_requirements = _get_requirements(
102 'requirements.txt', exclude=['setuptools'])
102 'requirements.txt', exclude=['setuptools'])
103 test_requirements = _get_requirements(
103 test_requirements = _get_requirements(
104 'requirements_test.txt', extras=['configobj'])
104 'requirements_test.txt', extras=['configobj'])
105
105
106
106
107 def get_version():
107 def get_version():
108 version = pkgutil.get_data('vcsserver', 'VERSION')
108 version = pkgutil.get_data('vcsserver', 'VERSION')
109 return version.decode().strip()
109 return version.decode().strip()
110
110
111
111
112 # additional files that goes into package itself
112 # additional files that goes into package itself
113 package_data = {
113 package_data = {
114 '': ['*.txt', '*.rst'],
114 '': ['*.txt', '*.rst'],
115 'configs': ['*.ini'],
115 'configs': ['*.ini'],
116 'vcsserver': ['VERSION'],
116 'vcsserver': ['VERSION'],
117 }
117 }
118
118
119 description = 'Version Control System Server'
119 description = 'Version Control System Server'
120 keywords = ' '.join(['Version Control System'])
120 keywords = ' '.join(['Version Control System'])
121
121
122 # README/DESCRIPTION generation
122 # README/DESCRIPTION generation
123 readme_file = 'README.rst'
123 readme_file = 'README.rst'
124 changelog_file = 'CHANGES.rst'
124 changelog_file = 'CHANGES.rst'
125 try:
125 try:
126 long_description = codecs.open(readme_file).read() + '\n\n' + \
126 long_description = codecs.open(readme_file).read() + '\n\n' + \
127 codecs.open(changelog_file).read()
127 codecs.open(changelog_file).read()
128 except IOError as err:
128 except IOError as err:
129 sys.stderr.write(
129 sys.stderr.write(
130 "[WARNING] Cannot find file specified as long_description (%s)\n "
130 "[WARNING] Cannot find file specified as long_description (%s)\n "
131 "or changelog (%s) skipping that file" % (readme_file, changelog_file))
131 "or changelog (%s) skipping that file" % (readme_file, changelog_file))
132 long_description = description
132 long_description = description
133
133
134
134
135 setup(
135 setup(
136 name='rhodecode-vcsserver',
136 name='rhodecode-vcsserver',
137 version=get_version(),
137 version=get_version(),
138 description=description,
138 description=description,
139 long_description=long_description,
139 long_description=long_description,
140 keywords=keywords,
140 keywords=keywords,
141 license=__license__,
141 license=__license__,
142 author=__author__,
142 author=__author__,
143 author_email='support@rhodecode.com',
143 author_email='support@rhodecode.com',
144 url=__url__,
144 url=__url__,
145 setup_requires=setup_requirements,
145 setup_requires=setup_requirements,
146 install_requires=install_requirements,
146 install_requires=install_requirements,
147 tests_require=test_requirements,
147 tests_require=test_requirements,
148 zip_safe=False,
148 zip_safe=False,
149 packages=find_packages(exclude=["docs", "tests*"]),
149 packages=find_packages(exclude=["docs", "tests*"]),
150 package_data=package_data,
150 package_data=package_data,
151 include_package_data=True,
151 include_package_data=True,
152 classifiers=[
152 classifiers=[
153 'Development Status :: 6 - Mature',
153 'Development Status :: 6 - Mature',
154 'Intended Audience :: Developers',
154 'Intended Audience :: Developers',
155 'Operating System :: OS Independent',
155 'Operating System :: OS Independent',
156 'Topic :: Software Development :: Version Control',
156 'Topic :: Software Development :: Version Control',
157 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
157 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
158 'Programming Language :: Python :: 3.10',
158 'Programming Language :: Python :: 3.10',
159 ],
159 ],
160 entry_points={
160 entry_points={
161 'paste.app_factory': ['main=vcsserver.http_main:main']
161 'paste.app_factory': ['main=vcsserver.http_main:main']
162 },
162 },
163 )
163 )
General Comments 0
You need to be logged in to leave comments. Login now