Skip to content

Commit

Permalink
Merge pull request #293 from acsone/py312-sbi
Browse files Browse the repository at this point in the history
Upgrade to python 3.12
  • Loading branch information
sbidoul authored Jul 6, 2024
2 parents b32ce61 + d2fc796 commit 3089319
Show file tree
Hide file tree
Showing 19 changed files with 3,898 additions and 4,634 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ on:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
python-version: "3.12"
- name: Install tox
run: python -m pip install tox tox-gh-actions
run: python -m pip install tox
- name: Run tox
run: python -m tox
- uses: codecov/codecov-action@v3
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -23,7 +23,7 @@ repos:
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.0
hooks:
- id: flake8
name: flake8 except __init__.py
Expand All @@ -34,7 +34,7 @@ repos:
args: [--extend-ignore=F401] # ignore imported unused in __init__.py
files: __init__.py
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.1
rev: v3.16.0
hooks:
- id: pyupgrade
- repo: https://github.com/asottile/seed-isort-config
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04
LABEL maintainer="Odoo Community Association (OCA)"

ENV LANG=C.UTF-8 \
Expand Down
21 changes: 10 additions & 11 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# frozen requirements generated by pip-deepfreeze
coverage==6.5.0
iniconfig==1.1.1
pluggy==1.0.0
py==1.11.0
pytest==7.1.3
pytest-asyncio==0.19.0
pytest-cov==4.0.0
pytest-mock==3.9.0
coverage==7.5.4
iniconfig==2.0.0
pluggy==1.5.0
pytest==8.2.2
pytest-asyncio==0.23.7
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-vcr==1.0.2
pyyaml==6.0
vcrpy==4.2.1
wrapt==1.15.0
pyyaml==6.0.1
vcrpy==6.0.1
wrapt==1.16.0
120 changes: 59 additions & 61 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,72 +1,70 @@
# frozen requirements generated by pip-deepfreeze
aiohttp==3.9.2
aiosignal==1.2.0
amqp==5.1.1
aiohttp==3.9.5
aiosignal==1.3.1
amqp==5.2.0
appdirs==1.4.4
async-timeout==4.0.2
attrs==22.1.0
billiard==3.6.4.0
bleach==5.0.1
celery==5.2.7
certifi==2023.7.22
cffi==1.15.1
charset-normalizer==2.1.1
click==8.1.3
click-didyoumean==0.3.0
attrs==23.2.0
billiard==4.2.0
celery==5.4.0
certifi==2024.6.2
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
click-didyoumean==0.3.1
click-plugins==1.1.1
click-repl==0.2.0
commonmark==0.9.1
cryptography==42.0.4
docutils==0.19
flower==1.2.0
frozenlist==1.3.1
gidgethub==5.2.0
github3-py==3.2.0
humanize==4.4.0
click-repl==0.3.0
cryptography==42.0.8
docutils==0.21.2
flower==2.0.1
frozenlist==1.4.1
gidgethub==5.3.0
github3-py==4.0.1
humanize==4.9.0
idna==3.7
importlib-metadata==5.0.0
importlib-resources==6.3.1
jaraco-classes==3.2.3
importlib-metadata==7.2.1
jaraco-classes==3.4.0
jaraco-context==5.3.0
jaraco-functools==4.0.1
jeepney==0.8.0
keyring==23.9.3
kombu==5.2.4
lxml==4.9.1
manifestoo-core==1.5
more-itertools==8.14.0
multidict==6.0.2
odoorpc==0.8.0
packaging==23.1
pkginfo==1.8.3
prometheus-client==0.14.1
prompt-toolkit==3.0.31
pycparser==2.21
pygments==2.15.0
pyjwt==2.5.0
python-dateutil==2.8.2
pytz==2022.4
keyring==25.2.1
kombu==5.3.7
lxml==5.2.2
manifestoo-core==1.6
markdown-it-py==3.0.0
mdurl==0.1.2
more-itertools==10.3.0
multidict==6.0.5
nh3==0.2.17
odoorpc==0.10.1
packaging==24.1
pkginfo==1.11.1
prometheus-client==0.20.0
prompt-toolkit==3.0.47
pycparser==2.22
pygments==2.18.0
pyjwt==2.8.0
python-dateutil==2.9.0.post0
pytz==2024.1
raven==6.10.0
readme-renderer==37.2
redis==4.5.4
requests==2.31.0
requests-toolbelt==0.9.1
readme-renderer==43.0
redis==5.0.6
requests==2.32.3
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==12.5.1
rich==13.7.1
secretstorage==3.3.3
setuptools==56.0.0
setuptools-odoo==3.1.6
setuptools-scm==7.0.5
setuptools==70.1.1
setuptools-odoo==3.3
setuptools-scm==8.1.0
six==1.16.0
tomli==2.0.1
tornado==6.3.3
twine==4.0.1
types-cryptography==3.3.23
typing-extensions==4.3.0
tornado==6.4.1
twine==5.1.0
tzdata==2024.1
uritemplate==4.1.1
urllib3==1.26.18
vine==5.0.0
wcwidth==0.2.5
webencodings==0.5.1
urllib3==2.2.2
vine==5.1.0
wcwidth==0.2.13
wheel==0.43.0
whool==1.0
yarl==1.8.1
zipp==3.8.1
whool==1.0.1
yarl==1.9.4
zipp==3.19.2
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
author="Odoo Community Association (OCA)",
author_email="[email protected]",
url="https://github.com/OCA/oca-github-bot",
python_requires=">=3.8",
python_requires="==3.12.*",
setup_requires=["setuptools_scm"],
packages=find_packages("src"),
package_dir={"": "src"},
Expand All @@ -38,6 +38,7 @@
"lxml",
# for setuptools-odoo-make-default
"setuptools-odoo",
"setuptools",
# for whool-init
"whool",
# packaging
Expand Down
16 changes: 12 additions & 4 deletions src/oca_github_bot/build_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,20 @@ def build_and_publish_metapackage_wheel(
series: Tuple[int, int],
dry_run: bool,
):
setup_dir = os.path.join(addons_dir, "setup", "_metapackage")
setup_file = os.path.join(setup_dir, "setup.py")
if not os.path.isfile(setup_file):
setup_dir = Path(addons_dir) / "setup" / "_metapackage"
setup_file = setup_dir / "setup.py"
if not setup_file.is_file():
return
with tempfile.TemporaryDirectory() as dist_dir:
# Workaround for recent setuptools not generating long_description
# anymore (before it was generating UNKNOWN), and a long_description
# is required by twine check. We could fix setuptools-odoo-makedefault
# but that would not backfill the legacy. So here we are...
if "long_description" not in setup_file.read_text():
setup_dir.joinpath("setup.cfg").write_text(
"[metadata]\nlong_description = UNKNOWN\n"
)
if Builder.get().build_wheel_legacy(
Path(setup_dir), dist_dir, python_tag="py2" if series < (11, 0) else "py3"
setup_dir, dist_dir, python_tag="py2" if series < (11, 0) else "py3"
):
dist_publisher.publish(dist_dir, dry_run)
2 changes: 1 addition & 1 deletion src/oca_github_bot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def func_wrapper(*args, **kwargs):

WHEEL_BUILD_TOOLS = os.environ.get(
"WHEEL_BUILD_TOOLS",
"build,pip,setuptools<58,wheel,setuptools-odoo,whool",
"build,pip,setuptools<70,wheel,setuptools-odoo,whool",
).split(",")

# minimum Odoo series supported by the bot
Expand Down
2 changes: 1 addition & 1 deletion src/oca_github_bot/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def files_on_index(
r.raise_for_status()
parser = etree.HTMLParser()
tree = etree.parse(StringIO(r.text), parser)
for a in tree.iterfind("//a"):
for a in tree.iterfind(".//a"):
parsed_url = urlparse(a.get("href"))
p = PosixPath(parsed_url.path)
if parsed_url.fragment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interactions:
Connection:
- keep-alive
User-Agent:
- python-requests/2.25.1
- python-requests/2.32.3
method: GET
uri: https://pypi.org/simple/not-a-pkg/
response:
Expand All @@ -27,11 +27,11 @@ interactions:
Content-Type:
- text/plain; charset=UTF-8
Date:
- Sun, 07 Mar 2021 15:14:01 GMT
- Tue, 25 Jun 2024 21:52:36 GMT
Permissions-Policy:
- publickey-credentials-create=(self),publickey-credentials-get=(self),accelerometer=(),ambient-light-sensor=(),autoplay=(),battery=(),camera=(),display-capture=(),document-domain=(),encrypted-media=(),execution-while-not-rendered=(),execution-while-out-of-viewport=(),fullscreen=(),gamepad=(),geolocation=(),gyroscope=(),hid=(),identity-credentials-get=(),idle-detection=(),local-fonts=(),magnetometer=(),microphone=(),midi=(),otp-credentials=(),payment=(),picture-in-picture=(),screen-wake-lock=(),serial=(),speaker-selection=(),storage-access=(),usb=(),web-share=(),xr-spatial-tracking=()
Referrer-Policy:
- origin-when-cross-origin
Server:
- nginx/1.13.9
Strict-Transport-Security:
- max-age=31536000; includeSubDomains; preload
Vary:
Expand All @@ -47,9 +47,9 @@ interactions:
X-Permitted-Cross-Domain-Policies:
- none
X-Served-By:
- cache-bwi5121-BWI, cache-ams21063-AMS
- cache-iad-kiad7000068-IAD, cache-bru1480058-BRU
X-Timer:
- S1615130042.600947,VS0,VE109
- S1719352357.609813,VS0,VE113
X-XSS-Protection:
- 1; mode=block
status:
Expand Down
Loading

0 comments on commit 3089319

Please sign in to comment.