diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5bd12c7..4d4e127 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 }} diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cb4eea7..3600bbe 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,8 @@ +Unreleased +---------- + +- Add official support for Python 3.12 + 0.7.0 ----- diff --git a/devpi_plumber/client.py b/devpi_plumber/client.py index ada7f1e..ae8675a 100644 --- a/devpi_plumber/client.py +++ b/devpi_plumber/client.py @@ -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 diff --git a/extra-test-requirements.txt b/extra-test-requirements.txt index 82d249c..b981be5 100644 --- a/extra-test-requirements.txt +++ b/extra-test-requirements.txt @@ -1 +1 @@ -devpi-server>=5.2.0 \ No newline at end of file +devpi-server>=5.2.0 diff --git a/requirements.txt b/requirements.txt index 61815ab..665717a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -185,7 +176,6 @@ tomli==2.0.1 # build # check-manifest # coverage - # pep517 # pyproject-hooks # pytest # setuptools-scm @@ -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 @@ -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: diff --git a/tests/test_client.py b/tests/test_client.py index 8493e15..83af5e2 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -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): @@ -44,22 +44,22 @@ def test_devpi_client(self): devpi.create_user("user", password="password", email="user@example.com") 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: @@ -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: @@ -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) @@ -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): @@ -253,7 +253,7 @@ 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"}} @@ -261,7 +261,7 @@ def test_get_json(self): 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']) @@ -269,14 +269,14 @@ def test_get_json(self): 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'], []) @@ -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)