Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify compatibility with Python 3.12 #84

Merged
merged 3 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Unreleased
----------

- Add official support for Python 3.12

0.7.0
-----

Expand Down
2 changes: 1 addition & 1 deletion devpi_plumber/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def user(self):
"""
The user currently logged in or None.
"""
match = re.search('logged in as (\w+)', self._execute('use'))
match = re.search(r'logged in as (\w+)', self._execute('use'))
return match.group(1) if match else None


Expand Down
2 changes: 1 addition & 1 deletion extra-test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
devpi-server>=5.2.0
devpi-server>=5.2.0
48 changes: 19 additions & 29 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile --no-emit-index-url
# pip-compile --no-emit-index-url --strip-extras
#
aiohttp==3.8.6
aiohttp==3.9.0
# via devpi-server
aiosignal==1.3.1
# via aiohttp
Expand All @@ -22,31 +22,29 @@ attrs==23.1.0
# via
# aiohttp
# devpi-server
babel==2.13.0
babel==2.13.1
# via sphinx
build==1.0.3
# via
# check-manifest
# devpi-client
certifi==2023.7.22
certifi==2023.11.17
# via requests
cffi==1.16.0
# via argon2-cffi-bindings
charset-normalizer==3.3.0
# via
# aiohttp
# requests
charset-normalizer==3.3.2
# via requests
check-manifest==0.49
# via devpi-client
coverage[toml]==7.3.2
coverage==7.3.2
# via
# coverage
# pytest-cov
defusedxml==0.7.1
# via devpi-server
devpi-client==6.0.5
devpi-client==7.0.2
# via -r core-requirements.txt
devpi-common==3.7.2
devpi-common==4.0.2
# via
# devpi-client
# devpi-server
Expand Down Expand Up @@ -92,19 +90,17 @@ multidict==6.0.4
# via
# aiohttp
# yarl
packaging==21.3
packaging==23.2
# via
# build
# devpi-common
# pytest
# setuptools-scm
# sphinx
passlib[argon2]==1.7.4
passlib==1.7.4
# via devpi-server
pastedeploy==3.0.1
# via plaster-pastedeploy
pep517==0.13.0
# via devpi-client
pkginfo==1.9.6
# via devpi-client
plaster==1.1.2
Expand All @@ -113,7 +109,7 @@ plaster==1.1.2
# pyramid
plaster-pastedeploy==1.0.1
# via pyramid
platformdirs==3.11.0
platformdirs==4.0.0
# via
# devpi-client
# devpi-server
Expand All @@ -123,21 +119,16 @@ pluggy==1.3.0
# devpi-server
# pytest
py==1.11.0
# via
# devpi-client
# devpi-common
# devpi-server
# via devpi-server
pycparser==2.21
# via cffi
pygments==2.16.1
pygments==2.17.1
# via sphinx
pyparsing==3.1.1
# via packaging
pyproject-hooks==1.0.0
# via build
pyramid==2.0.2
# via devpi-server
pytest==7.4.2
pytest==7.4.3
# via
# -r requirements.in
# pytest-cov
Expand All @@ -154,7 +145,7 @@ requests==2.31.0
# -r core-requirements.txt
# devpi-common
# sphinx
ruamel-yaml==0.17.35
ruamel-yaml==0.18.5
# via devpi-server
ruamel-yaml-clib==0.2.8
# via ruamel-yaml
Expand Down Expand Up @@ -185,7 +176,6 @@ tomli==2.0.1
# build
# check-manifest
# coverage
# pep517
# pyproject-hooks
# pytest
# setuptools-scm
Expand All @@ -199,9 +189,9 @@ twitter-common-lang==0.3.11
# via twitter-common-dirutil
typing-extensions==4.8.0
# via setuptools-scm
urllib3==2.0.7
urllib3==2.1.0
# via requests
venusian==3.0.0
venusian==3.1.0
# via pyramid
waitress==2.1.2
# via devpi-server
Expand All @@ -213,7 +203,7 @@ zipp==3.17.0
# via importlib-metadata
zope-deprecation==5.0
# via pyramid
zope-interface==6.0
zope-interface==6.1
# via pyramid

# The following packages are considered to be unsafe in a requirements file:
Expand Down
30 changes: 15 additions & 15 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def test_user_session(self):
users = {"user": {"password": "secret"}}

with TestServer(users) as devpi:
self.assertEquals('root', devpi.user)
self.assertEqual('root', devpi.user)
with devpi.user_session('user', 'secret'):
self.assertEquals("user", devpi.user)
self.assertEqual("user", devpi.user)
self.assertIsNone(devpi.user)

def test_devpi_client(self):
Expand All @@ -44,22 +44,22 @@ def test_devpi_client(self):
devpi.create_user("user", password="password", email="[email protected]")
self.assertEqual(200, requests.get(devpi.server_url + "/user").status_code)
self.assertIn("credentials valid", devpi.login("user", "password"))
self.assertEquals("user", devpi.user)
self.assertEqual("user", devpi.user)

def test_login_success(self):
users = {"user": {"password": "secret"}}

with TestServer(users) as devpi:
self.assertIn("credentials valid", devpi.login("user", "secret"))
self.assertEquals("user", devpi.user)
self.assertEqual("user", devpi.user)

def test_login_error(self):
users = {"user": {"password": "secret"}}

with TestServer(users) as devpi:
with self.assertRaisesRegexp(DevpiClientError, "401 Unauthorized"):
with self.assertRaisesRegex(DevpiClientError, "401 Unauthorized"):
devpi.login('user', 'wrong password')
self.assertEquals('root', devpi.user)
self.assertEqual('root', devpi.user)

def test_logoff(self):
with TestServer() as devpi:
Expand All @@ -74,7 +74,7 @@ def test_use(self):
def test_url(self):
with TestServer() as devpi:
devpi.use("root/pypi")
self.assertEquals(devpi.server_url + "/root/pypi", devpi.url)
self.assertEqual(devpi.server_url + "/root/pypi", devpi.url)

def test_create_user(self):
with TestServer() as devpi:
Expand Down Expand Up @@ -132,7 +132,7 @@ def test_list_indices(self):

with TestServer(users, indices) as devpi:
listed = devpi.list_indices()
self.assertEquals(2, len(listed))
self.assertEqual(2, len(listed))
self.assertIn('root/pypi', listed)
self.assertIn('user/index', listed)

Expand Down Expand Up @@ -220,7 +220,7 @@ def test_list_error(self):
indices = {"user/index": {}}

with TestServer(users, indices) as devpi:
with self.assertRaisesRegexp(DevpiClientError, "not connected to an index"):
with self.assertRaisesRegex(DevpiClientError, "not connected to an index"):
devpi.list("test_package==0.1")

def test_replica(self):
Expand Down Expand Up @@ -253,30 +253,30 @@ def test_remove_invalid(self):

devpi.remove("test_package==0.2")

self.assertEquals(2, len(devpi.list("test_package==0.1")))
self.assertEqual(2, len(devpi.list("test_package==0.1")))

def test_get_json(self):
users = {"user": {"password": "secret"}}
indices = {"user/index": {}}

with TestServer(users, indices) as devpi:
root = devpi.get_json('/')
self.assertEquals(root['type'], 'list:userconfig')
self.assertEqual(root['type'], 'list:userconfig')
self.assertIn('root', root['result'])
self.assertIn('user', root['result'])

with self.assertRaises(DevpiClientError):
devpi.get_json('/foo')

user = devpi.get_json('/user')
self.assertEquals(user['type'], 'userconfig')
self.assertEqual(user['type'], 'userconfig')
self.assertIn('index', user['result']['indexes'])

with self.assertRaises(DevpiClientError):
devpi.get_json('/user/foo')

index = devpi.get_json('/user/index')
self.assertEquals(index['type'], 'indexconfig')
self.assertEqual(index['type'], 'indexconfig')
self.assertListEqual(index['result']['acl_upload'], ['user'])
self.assertListEqual(index['result']['projects'], [])

Expand All @@ -293,11 +293,11 @@ def test_get_json(self):
self.assertListEqual(index['result']['projects'], ['test-package'])

package = devpi.get_json('/user/index/test-package')
self.assertEquals(package['type'], 'projectconfig')
self.assertEqual(package['type'], 'projectconfig')
self.assertIn('0.1', package['result'])

version = devpi.get_json('/user/index/test-package/0.1')
self.assertEquals(version['type'], 'versiondata')
self.assertEqual(version['type'], 'versiondata')
links = '\n'.join([link['href'] for link in version['result']['+links']])
self.assertIn('test_package-0.1-py2.py3-none-any.whl', links)
self.assertIn('test-package-0.1.doc.zip', links)
Expand Down