Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5fa0e16

Browse files
Merge pull request#980 from python-gitlab/refactor/cleanup-upgrade
Refactor/cleanup upgrade
2 parents5a10eb3 +c817dcc commit5fa0e16

File tree

15 files changed

+39
-66
lines changed

15 files changed

+39
-66
lines changed

‎.travis.yml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,49 +21,31 @@ jobs:
2121
-stage:lint
2222
name:black_lint
2323
dist:bionic
24-
python:3.7
24+
python:3.8
2525
script:
2626
-pip3 install -U --pre black
2727
-black --check .
2828
-stage:test
2929
name:cli_func_v4
3030
dist:bionic
31-
python:3.7
31+
python:3.8
3232
script:
3333
-pip3 install tox
3434
-tox -e cli_func_v4
3535
-stage:test
3636
name:py_func_v4
3737
dist:bionic
38-
python:3.7
38+
python:3.8
3939
script:
4040
-pip3 install tox
4141
-tox -e py_func_v4
4242
-stage:test
4343
name:docs
4444
dist:bionic
45-
python:3.7
45+
python:3.8
4646
script:
4747
-pip3 install tox
4848
-tox -e docs
49-
-stage:test
50-
name:py27
51-
python:2.7
52-
script:
53-
-pip2 install tox
54-
-tox -e py27
55-
-stage:test
56-
name:py34
57-
python:3.4
58-
script:
59-
-pip3 install tox
60-
-tox -e py34
61-
-stage:test
62-
name:py35
63-
python:3.5
64-
script:
65-
-pip3 install tox
66-
-tox -e py35
6749
-stage:test
6850
name:py36
6951
python:3.6
@@ -81,7 +63,7 @@ jobs:
8163
-stage:test
8264
dist:bionic
8365
name:py38
84-
python:3.8-dev
66+
python:3.8
8567
script:
8668
-pip3 install tox
8769
-tox -e py38

‎Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM python:3.7-alpine AS build
1+
FROM python:3.8-alpine AS build
22

33
WORKDIR /opt/python-gitlab
44
COPY . .
55
RUN python setup.py bdist_wheel
66

7-
FROM python:3.7-alpine
7+
FROM python:3.8-alpine
88

99
WORKDIR /opt/python-gitlab
1010
COPY --from=build /opt/python-gitlab/dist dist/

‎README.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Requirements
3232
python-gitlab depends on:
3333

3434
* `python-requests<http://docs.python-requests.org/en/latest/>`_
35-
* `six<https://six.readthedocs.io/>`_
3635

3736
Install with pip
3837
----------------

‎docs/cli.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ These options must be defined before the mandatory arguments.
162162
**Notice:**
163163

164164
The `PyYAML package<https://pypi.org/project/PyYAML/>`_ is required to use the yaml output option.
165-
You need to install itseparately using ``pip installPyYAML``
165+
You need to install itexplicitly using ``pip installpython-gitlab[yaml]``
166166

167167
``--fields``, ``-f``
168168
Comma-separated list of fields to display (``yaml`` and ``json`` output

‎docs/ext/docstrings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
importos
44

55
importjinja2
6-
importsix
76
importsphinx
87
importsphinx.ext.napoleonasnapoleon
98
fromsphinx.ext.napoleon.docstringimportGoogleDocstring
@@ -25,7 +24,7 @@ def setup(app):
2524

2625
conf=napoleon.Config._config_values
2726

28-
forname, (default,rebuild)insix.iteritems(conf):
27+
forname, (default,rebuild)inconf.items():
2928
app.add_config_value(name,default,rebuild)
3029
return {"version":sphinx.__display_version__,"parallel_read_safe":True}
3130

‎gitlab/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@
2323
importwarnings
2424

2525
importrequests
26-
importsix
2726

2827
importgitlab.config
2928
fromgitlab.constimport*# noqa
3029
fromgitlab.exceptionsimport*# noqa
3130
fromgitlabimportutils# noqa
3231

3332
__title__="python-gitlab"
34-
__version__="1.15.0"
33+
__version__="2.0.0"
3534
__author__="Gauvain Pocentek"
3635
__email__="gauvainpocentek@gmail.com"
3736
__license__="LGPL3"
@@ -47,8 +46,8 @@
4746

4847
def_sanitize(value):
4948
ifisinstance(value,dict):
50-
returndict((k,_sanitize(v))fork,vinsix.iteritems(value))
51-
ifisinstance(value,six.string_types):
49+
returndict((k,_sanitize(v))fork,vinvalue.items())
50+
ifisinstance(value,str):
5251
returnvalue.replace("/","%2F")
5352
returnvalue
5453

‎gitlab/config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

1818
importos
19-
20-
fromsix.movesimportconfigparser
19+
importconfigparser
2120

2221
_DEFAULT_FILES= ["/etc/python-gitlab.cfg",os.path.expanduser("~/.python-gitlab.cfg")]
2322

‎gitlab/tests/test_cli.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
importos
2121
importtempfile
2222
importunittest
23+
importio
2324

2425
try:
2526
fromcontextlibimportredirect_stderr# noqa: H302
@@ -34,8 +35,6 @@ def redirect_stderr(new_target):
3435
sys.stderr=old_target
3536

3637

37-
importsix
38-
3938
fromgitlabimportcli
4039
importgitlab.v4.cli
4140

@@ -56,7 +55,7 @@ class TestClass(object):
5655
self.assertEqual("class",cli.cls_to_what(Class))
5756

5857
deftest_die(self):
59-
fl=six.StringIO()
58+
fl=io.StringIO()
6059
withredirect_stderr(fl):
6160
withself.assertRaises(SystemExit)astest:
6261
cli.die("foobar")
@@ -83,7 +82,7 @@ def test_parse_value(self):
8382
self.assertEqual(ret,"content")
8483
os.unlink(temp_path)
8584

86-
fl=six.StringIO()
85+
fl=io.StringIO()
8786
withredirect_stderr(fl):
8887
withself.assertRaises(SystemExit)asexc:
8988
cli._parse_value("@/thisfileprobablydoesntexist")

‎gitlab/tests/test_config.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
importunittest
1919

2020
importmock
21-
importsix
21+
importio
2222

2323
fromgitlabimportconfig
2424

@@ -80,26 +80,26 @@ def test_missing_config(self, path_exists):
8080
config.GitlabConfigParser("test")
8181

8282
@mock.patch("os.path.exists")
83-
@mock.patch("six.moves.builtins.open")
83+
@mock.patch("builtins.open")
8484
deftest_invalid_id(self,m_open,path_exists):
85-
fd=six.StringIO(no_default_config)
85+
fd=io.StringIO(no_default_config)
8686
fd.close=mock.Mock(return_value=None)
8787
m_open.return_value=fd
8888
path_exists.return_value=True
8989
config.GitlabConfigParser("there")
9090
self.assertRaises(config.GitlabIDError,config.GitlabConfigParser)
9191

92-
fd=six.StringIO(valid_config)
92+
fd=io.StringIO(valid_config)
9393
fd.close=mock.Mock(return_value=None)
9494
m_open.return_value=fd
9595
self.assertRaises(
9696
config.GitlabDataError,config.GitlabConfigParser,gitlab_id="not_there"
9797
)
9898

9999
@mock.patch("os.path.exists")
100-
@mock.patch("six.moves.builtins.open")
100+
@mock.patch("builtins.open")
101101
deftest_invalid_data(self,m_open,path_exists):
102-
fd=six.StringIO(missing_attr_config)
102+
fd=io.StringIO(missing_attr_config)
103103
fd.close=mock.Mock(return_value=None,side_effect=lambda:fd.seek(0))
104104
m_open.return_value=fd
105105
path_exists.return_value=True
@@ -117,9 +117,9 @@ def test_invalid_data(self, m_open, path_exists):
117117
self.assertEqual("Unsupported per_page number: 200",emgr.exception.args[0])
118118

119119
@mock.patch("os.path.exists")
120-
@mock.patch("six.moves.builtins.open")
120+
@mock.patch("builtins.open")
121121
deftest_valid_data(self,m_open,path_exists):
122-
fd=six.StringIO(valid_config)
122+
fd=io.StringIO(valid_config)
123123
fd.close=mock.Mock(return_value=None)
124124
m_open.return_value=fd
125125
path_exists.return_value=True
@@ -133,7 +133,7 @@ def test_valid_data(self, m_open, path_exists):
133133
self.assertEqual(True,cp.ssl_verify)
134134
self.assertIsNone(cp.per_page)
135135

136-
fd=six.StringIO(valid_config)
136+
fd=io.StringIO(valid_config)
137137
fd.close=mock.Mock(return_value=None)
138138
m_open.return_value=fd
139139
cp=config.GitlabConfigParser(gitlab_id="two")
@@ -144,7 +144,7 @@ def test_valid_data(self, m_open, path_exists):
144144
self.assertEqual(10,cp.timeout)
145145
self.assertEqual(False,cp.ssl_verify)
146146

147-
fd=six.StringIO(valid_config)
147+
fd=io.StringIO(valid_config)
148148
fd.close=mock.Mock(return_value=None)
149149
m_open.return_value=fd
150150
cp=config.GitlabConfigParser(gitlab_id="three")
@@ -156,7 +156,7 @@ def test_valid_data(self, m_open, path_exists):
156156
self.assertEqual("/path/to/CA/bundle.crt",cp.ssl_verify)
157157
self.assertEqual(50,cp.per_page)
158158

159-
fd=six.StringIO(valid_config)
159+
fd=io.StringIO(valid_config)
160160
fd.close=mock.Mock(return_value=None)
161161
m_open.return_value=fd
162162
cp=config.GitlabConfigParser(gitlab_id="four")

‎gitlab/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# You should have received a copy of the GNU Lesser General Public License
1616
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

18-
importsix
18+
fromurllib.parseimporturlparse
1919

2020

2121
class_StdoutStream(object):
@@ -52,6 +52,6 @@ def clean_str_id(id):
5252

5353

5454
defsanitized_url(url):
55-
parsed=six.moves.urllib.parse.urlparse(url)
55+
parsed=urlparse(url)
5656
new_path=parsed.path.replace(".","%2E")
5757
returnparsed._replace(path=new_path).geturl()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp