Skip to content

Commit 5669aa0

Browse files
Add python3.14 support and fix tests
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent 9035794 commit 5669aa0

9 files changed

+1387
-28
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ packvers==21.5
1616
pip-requirements-parser==32.0.1
1717
pkginfo2==30.0.0
1818
pydantic_settings == 2.8.1
19-
pydantic == 2.11.2
19+
pydantic == 2.12.3
2020
pyparsing==3.0.9
2121
PyYAML==6.0
2222
requests==2.28.1

src/_packagedcode/pypi_setup_py.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ def node_to_value(node, body):
123123
if isinstance(node, ast.Constant):
124124
return node.value
125125

126-
if isinstance(node, ast.Str):
126+
if isinstance(node, ast.Constant) and isinstance(node.value, str):
127127
return node.s
128128

129-
if isinstance(node, ast.Num):
129+
if isinstance(node, ast.Constant) and isinstance(node.value, int):
130130
return node.n
131131

132132
if isinstance(node, (ast.List, ast.Tuple, ast.Set,)):

tests/data/azure-devops.req-310-expected.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,8 +1287,7 @@
12871287
{
12881288
"package": "pkg:pypi/[email protected]",
12891289
"dependencies": [
1290-
"pkg:pypi/[email protected]",
1291-
"pkg:pypi/[email protected]"
1290+
"pkg:pypi/[email protected]"
12921291
]
12931292
},
12941293
{

tests/data/azure-devops.req-312-expected.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,8 +1287,7 @@
12871287
{
12881288
"package": "pkg:pypi/[email protected]",
12891289
"dependencies": [
1290-
"pkg:pypi/[email protected]",
1291-
"pkg:pypi/[email protected]"
1290+
"pkg:pypi/[email protected]"
12921291
]
12931292
},
12941293
{

tests/data/azure-devops.req-313-expected.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,8 +1287,7 @@
12871287
{
12881288
"package": "pkg:pypi/[email protected]",
12891289
"dependencies": [
1290-
"pkg:pypi/[email protected]",
1291-
"pkg:pypi/[email protected]"
1290+
"pkg:pypi/[email protected]"
12921291
]
12931292
},
12941293
{

tests/data/azure-devops.req-314-expected.json

Lines changed: 1345 additions & 0 deletions
Large diffs are not rendered by default.

tests/data/azure-devops.req-38-expected.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -576,17 +576,17 @@
576576
"type": "pypi",
577577
"namespace": null,
578578
"name": "cryptography",
579-
"version": "46.0.0",
579+
"version": "45.0.7",
580580
"qualifiers": {},
581581
"subpath": null,
582582
"primary_language": "Python",
583-
"description": "cryptography is a package which provides cryptographic recipes and primitives to Python developers.\npyca/cryptography\n=================\n\n.. image:: https://img.shields.io/pypi/v/cryptography.svg\n :target: https://pypi.org/project/cryptography/\n :alt: Latest Version\n\n.. image:: https://readthedocs.org/projects/cryptography/badge/?version=latest\n :target: https://cryptography.io\n :alt: Latest Docs\n\n.. image:: https://github.com/pyca/cryptography/actions/workflows/ci.yml/badge.svg\n :target: https://github.com/pyca/cryptography/actions/workflows/ci.yml?query=branch%3Amain\n\n``cryptography`` is a package which provides cryptographic recipes and\nprimitives to Python developers. Our goal is for it to be your \"cryptographic\nstandard library\". It supports Python 3.8+ and PyPy3 7.3.11+.\n\n``cryptography`` includes both high level recipes and low level interfaces to\ncommon cryptographic algorithms such as symmetric ciphers, message digests, and\nkey derivation functions. For example, to encrypt something with\n``cryptography``'s high level symmetric encryption recipe:\n\n.. code-block:: pycon\n\n >>> from cryptography.fernet import Fernet\n >>> # Put this somewhere safe!\n >>> key = Fernet.generate_key()\n >>> f = Fernet(key)\n >>> token = f.encrypt(b\"A really secret message. Not for prying eyes.\")\n >>> token\n b'...'\n >>> f.decrypt(token)\n b'A really secret message. Not for prying eyes.'\n\nYou can find more information in the `documentation`_.\n\nYou can install ``cryptography`` with:\n\n.. code-block:: console\n\n $ pip install cryptography\n\nFor full details see `the installation documentation`_.\n\nDiscussion\n~~~~~~~~~~\n\nIf you run into bugs, you can file them in our `issue tracker`_.\n\nWe maintain a `cryptography-dev`_ mailing list for development discussion.\n\nYou can also join ``#pyca`` on ``irc.libera.chat`` to ask questions or get\ninvolved.\n\nSecurity\n~~~~~~~~\n\nNeed to report a security issue? Please consult our `security reporting`_\ndocumentation.\n\n\n.. _`documentation`: https://cryptography.io/\n.. _`the installation documentation`: https://cryptography.io/en/latest/installation/\n.. _`issue tracker`: https://github.com/pyca/cryptography/issues\n.. _`cryptography-dev`: https://mail.python.org/mailman/listinfo/cryptography-dev\n.. _`security reporting`: https://cryptography.io/en/latest/security/",
584-
"release_date": "2025-09-16T21:07:03",
583+
"description": "cryptography is a package which provides cryptographic recipes and primitives to Python developers.\npyca/cryptography\n=================\n\n.. image:: https://img.shields.io/pypi/v/cryptography.svg\n :target: https://pypi.org/project/cryptography/\n :alt: Latest Version\n\n.. image:: https://readthedocs.org/projects/cryptography/badge/?version=latest\n :target: https://cryptography.io\n :alt: Latest Docs\n\n.. image:: https://github.com/pyca/cryptography/workflows/CI/badge.svg?branch=main\n :target: https://github.com/pyca/cryptography/actions?query=workflow%3ACI+branch%3Amain\n\n\n``cryptography`` is a package which provides cryptographic recipes and\nprimitives to Python developers. Our goal is for it to be your \"cryptographic\nstandard library\". It supports Python 3.7+ and PyPy3 7.3.11+.\n\n``cryptography`` includes both high level recipes and low level interfaces to\ncommon cryptographic algorithms such as symmetric ciphers, message digests, and\nkey derivation functions. For example, to encrypt something with\n``cryptography``'s high level symmetric encryption recipe:\n\n.. code-block:: pycon\n\n >>> from cryptography.fernet import Fernet\n >>> # Put this somewhere safe!\n >>> key = Fernet.generate_key()\n >>> f = Fernet(key)\n >>> token = f.encrypt(b\"A really secret message. Not for prying eyes.\")\n >>> token\n b'...'\n >>> f.decrypt(token)\n b'A really secret message. Not for prying eyes.'\n\nYou can find more information in the `documentation`_.\n\nYou can install ``cryptography`` with:\n\n.. code-block:: console\n\n $ pip install cryptography\n\nFor full details see `the installation documentation`_.\n\nDiscussion\n~~~~~~~~~~\n\nIf you run into bugs, you can file them in our `issue tracker`_.\n\nWe maintain a `cryptography-dev`_ mailing list for development discussion.\n\nYou can also join ``#pyca`` on ``irc.libera.chat`` to ask questions or get\ninvolved.\n\nSecurity\n~~~~~~~~\n\nNeed to report a security issue? Please consult our `security reporting`_\ndocumentation.\n\n\n.. _`documentation`: https://cryptography.io/\n.. _`the installation documentation`: https://cryptography.io/en/latest/installation/\n.. _`issue tracker`: https://github.com/pyca/cryptography/issues\n.. _`cryptography-dev`: https://mail.python.org/mailman/listinfo/cryptography-dev\n.. _`security reporting`: https://cryptography.io/en/latest/security/",
584+
"release_date": "2025-09-01T11:14:24",
585585
"parties": [
586586
{
587587
"type": "person",
588588
"role": "author",
589-
"name": null,
589+
"name": "The cryptography developers <[email protected]>",
590590
"email": "The Python Cryptographic Authority and individual contributors <[email protected]>",
591591
"url": null
592592
}
@@ -607,37 +607,38 @@
607607
"Programming Language :: Python :: 3.11",
608608
"Programming Language :: Python :: 3.12",
609609
"Programming Language :: Python :: 3.13",
610-
"Programming Language :: Python :: 3.14",
610+
"Programming Language :: Python :: 3.7",
611611
"Programming Language :: Python :: 3.8",
612612
"Programming Language :: Python :: 3.9",
613-
"Programming Language :: Python :: Free Threading :: 3 - Stable",
614613
"Programming Language :: Python :: Implementation :: CPython",
615614
"Programming Language :: Python :: Implementation :: PyPy",
616615
"Topic :: Security :: Cryptography"
617616
],
618617
"homepage_url": null,
619-
"download_url": "https://files.pythonhosted.org/packages/da/94/f1c1f30110c05fa5247bf460b17acfd52fa3f5c77e94ba19cff8957dc5e6/cryptography-46.0.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
620-
"size": 4562561,
618+
"download_url": "https://files.pythonhosted.org/packages/eb/ac/59b7790b4ccaed739fc44775ce4645c9b8ce54cbec53edf16c74fd80cb2b/cryptography-45.0.7-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
619+
"size": 4423075,
621620
"sha1": null,
622-
"md5": "4fe77bef21236be92883b98ea2b89580",
623-
"sha256": "c3cd09b1490c1509bf3892bde9cef729795fae4a2fee0621f19be3321beca7e4",
621+
"md5": "d7c4a989694c8af7d27560ff4125516f",
622+
"sha256": "3994c809c17fc570c2af12c9b840d7cea85a9fd3e5c0e0491f4fa3c029216d59",
624623
"sha512": null,
625624
"bug_tracking_url": null,
626625
"code_view_url": null,
627626
"vcs_url": null,
628627
"copyright": null,
629-
"license_expression": "Apache-2.0 OR BSD-3-Clause",
630-
"declared_license": {},
628+
"license_expression": null,
629+
"declared_license": {
630+
"license": "Apache-2.0 OR BSD-3-Clause"
631+
},
631632
"notice_text": null,
632633
"source_packages": [],
633634
"file_references": [],
634635
"extra_data": {},
635636
"dependencies": [],
636637
"repository_homepage_url": null,
637638
"repository_download_url": null,
638-
"api_data_url": "https://pypi.org/pypi/cryptography/46.0.0/json",
639+
"api_data_url": "https://pypi.org/pypi/cryptography/45.0.7/json",
639640
"datasource_id": null,
640-
"purl": "pkg:pypi/cryptography@46.0.0"
641+
"purl": "pkg:pypi/cryptography@45.0.7"
641642
},
642643
{
643644
"type": "pypi",
@@ -1327,7 +1328,7 @@
13271328
"package": "pkg:pypi/[email protected]",
13281329
"dependencies": [
13291330
"pkg:pypi/[email protected]",
1330-
"pkg:pypi/cryptography@46.0.0",
1331+
"pkg:pypi/cryptography@45.0.7",
13311332
"pkg:pypi/[email protected]",
13321333
"pkg:pypi/[email protected]"
13331334
]
@@ -1351,10 +1352,9 @@
13511352
"dependencies": []
13521353
},
13531354
{
1354-
"package": "pkg:pypi/cryptography@46.0.0",
1355+
"package": "pkg:pypi/cryptography@45.0.7",
13551356
"dependencies": [
1356-
"pkg:pypi/[email protected]",
1357-
"pkg:pypi/[email protected]"
1357+
"pkg:pypi/[email protected]"
13581358
]
13591359
},
13601360
{

tests/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def test_api_with_unsupported_os():
9999

100100
def test_api_with_wrong_pyver():
101101
with pytest.raises(ValueError):
102-
resolver_api(specifiers=["flask==2.1.2"], python_version="3.14", operating_system="linux")
102+
resolver_api(specifiers=["flask==2.1.2"], python_version="3.15", operating_system="linux")
103103

104104

105105
@pytest.mark.online

tests/test_cli.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,23 @@ def test_cli_with_azure_devops_with_python_312():
313313
regen=REGEN_TEST_FIXTURES,
314314
)
315315

316+
@pytest.mark.online
317+
def test_cli_with_azure_devops_with_python_313():
318+
requirements_file = test_env.get_test_loc("azure-devops.req.txt")
319+
expected_file = test_env.get_test_loc("azure-devops.req-314-expected.json", must_exist=False)
320+
extra_options = [
321+
"--operating-system",
322+
"linux",
323+
"--python-version",
324+
"314",
325+
]
326+
check_requirements_resolution(
327+
requirements_file=requirements_file,
328+
expected_file=expected_file,
329+
extra_options=extra_options,
330+
regen=REGEN_TEST_FIXTURES,
331+
)
332+
316333

317334
@pytest.mark.online
318335
def test_cli_with_azure_devops_with_python_313():

0 commit comments

Comments
 (0)