-
Notifications
You must be signed in to change notification settings - Fork 6
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
Update Container + Python #341
Conversation
I've fixed the docker compose so it'll work with |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Our dev container seems in a bad state. VSCode voices several complaints about
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I think my first pass of review is complete. The commands in the container seem to work fine; it's just a few little packaging details to sort out.
Builds just fine for me. That's what I've been using for changes, and the compose to verify. Also I haven't changed this piece (though it is now inside ubuntu 24.04 🤷 ) |
c0d402d
to
8893726
Compare
This updates the container to Ubuntu 24.04, which comes with Python 3.12
This switches away from setup.py to the now standardised pyproject.toml.
8893726
to
341b1ef
Compare
That should work. Pip knows how how to deal with |
For completeness, installing from source control via pip ➜ /tmp mkdir xkan && cd xkan
➜ xkan python3.12 -m venv venv
➜ xkan source venv/bin/activate
(venv) ➜ xkan pip install 'git+https://github.com/techman83/NetKAN-Infra.git@feat/update-python#subdirectory=netkan'
Collecting git+https://github.com/techman83/NetKAN-Infra.git@feat/update-python#subdirectory=netkan
Cloning https://github.com/techman83/NetKAN-Infra.git (to revision feat/update-python) to /tmp/pip-req-build-gvsq2y6w
Running command git clone --filter=blob:none --quiet https://github.com/techman83/NetKAN-Infra.git /tmp/pip-req-build-gvsq2y6w
Running command git checkout -b feat/update-python --track origin/feat/update-python
Switched to a new branch 'feat/update-python'
branch 'feat/update-python' set up to track 'origin/feat/update-python'.
Resolved https://github.com/techman83/NetKAN-Infra.git to commit 341b1ef443bb741f0eb4b0bbaf1f7fbc37233ede
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting boto3 (from netkan==1.0)
Using cached boto3-1.35.22-py3-none-any.whl.metadata (6.6 kB)
Collecting click (from netkan==1.0)
Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting gitpython (from netkan==1.0)
Using cached GitPython-3.1.43-py3-none-any.whl.metadata (13 kB)
Collecting pynamodb (from netkan==1.0)
Using cached pynamodb-6.0.1-py3-none-any.whl.metadata (6.7 kB)
Collecting python-dateutil<2.8.1,>=2.1 (from netkan==1.0)
Using cached python_dateutil-2.8.0-py2.py3-none-any.whl.metadata (7.6 kB)
Collecting requests (from netkan==1.0)
Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting flask (from netkan==1.0)
Using cached flask-3.0.3-py3-none-any.whl.metadata (3.2 kB)
Collecting jinja2 (from netkan==1.0)
Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
Collecting internetarchive!=3.0.1 (from netkan==1.0)
Using cached internetarchive-4.1.0-py3-none-any.whl.metadata (4.9 kB)
Collecting gunicorn!=20.0.0,>=19.9 (from netkan==1.0)
Using cached gunicorn-23.0.0-py3-none-any.whl.metadata (4.4 kB)
Collecting discord.py<=1.7.3,>=1.6.0 (from netkan==1.0)
Using cached discord.py-1.7.3-py3-none-any.whl.metadata (4.1 kB)
Collecting PyGithub (from netkan==1.0)
Using cached PyGithub-2.4.0-py3-none-any.whl.metadata (3.9 kB)
Collecting ruamel.yaml (from netkan==1.0)
Using cached ruamel.yaml-0.18.6-py3-none-any.whl.metadata (23 kB)
Collecting aiohttp<3.8.0,>=3.6.0 (from discord.py<=1.7.3,>=1.6.0->netkan==1.0)
Using cached aiohttp-3.7.4.post0.tar.gz (1.1 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting packaging (from gunicorn!=20.0.0,>=19.9->netkan==1.0)
Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
Collecting docopt<0.7.0,>=0.6.0 (from internetarchive!=3.0.1->netkan==1.0)
Using cached docopt-0.6.2.tar.gz (25 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting jsonpatch>=0.4 (from internetarchive!=3.0.1->netkan==1.0)
Downloading jsonpatch-1.33-py2.py3-none-any.whl.metadata (3.0 kB)
Collecting schema>=0.4.0 (from internetarchive!=3.0.1->netkan==1.0)
Downloading schema-0.7.7-py2.py3-none-any.whl.metadata (34 kB)
Collecting tqdm>=4.0.0 (from internetarchive!=3.0.1->netkan==1.0)
Using cached tqdm-4.66.5-py3-none-any.whl.metadata (57 kB)
Collecting urllib3>=1.26.0 (from internetarchive!=3.0.1->netkan==1.0)
Downloading urllib3-2.2.3-py3-none-any.whl.metadata (6.5 kB)
Collecting six>=1.5 (from python-dateutil<2.8.1,>=2.1->netkan==1.0)
Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting charset-normalizer<4,>=2 (from requests->netkan==1.0)
Using cached charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (33 kB)
Collecting idna<4,>=2.5 (from requests->netkan==1.0)
Downloading idna-3.10-py3-none-any.whl.metadata (10 kB)
Collecting certifi>=2017.4.17 (from requests->netkan==1.0)
Using cached certifi-2024.8.30-py3-none-any.whl.metadata (2.2 kB)
Collecting botocore<1.36.0,>=1.35.22 (from boto3->netkan==1.0)
Downloading botocore-1.35.22-py3-none-any.whl.metadata (5.7 kB)
Collecting jmespath<2.0.0,>=0.7.1 (from boto3->netkan==1.0)
Downloading jmespath-1.0.1-py3-none-any.whl.metadata (7.6 kB)
Collecting s3transfer<0.11.0,>=0.10.0 (from boto3->netkan==1.0)
Downloading s3transfer-0.10.2-py3-none-any.whl.metadata (1.7 kB)
Collecting Werkzeug>=3.0.0 (from flask->netkan==1.0)
Downloading werkzeug-3.0.4-py3-none-any.whl.metadata (3.7 kB)
Collecting itsdangerous>=2.1.2 (from flask->netkan==1.0)
Downloading itsdangerous-2.2.0-py3-none-any.whl.metadata (1.9 kB)
Collecting blinker>=1.6.2 (from flask->netkan==1.0)
Downloading blinker-1.8.2-py3-none-any.whl.metadata (1.6 kB)
Collecting MarkupSafe>=2.0 (from jinja2->netkan==1.0)
Using cached MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.0 kB)
Collecting gitdb<5,>=4.0.1 (from gitpython->netkan==1.0)
Using cached gitdb-4.0.11-py3-none-any.whl.metadata (1.2 kB)
Collecting pynacl>=1.4.0 (from PyGithub->netkan==1.0)
Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.metadata (8.6 kB)
Collecting pyjwt>=2.4.0 (from pyjwt[crypto]>=2.4.0->PyGithub->netkan==1.0)
Downloading PyJWT-2.9.0-py3-none-any.whl.metadata (3.0 kB)
Collecting typing-extensions>=4.0.0 (from PyGithub->netkan==1.0)
Using cached typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Collecting Deprecated (from PyGithub->netkan==1.0)
Downloading Deprecated-1.2.14-py2.py3-none-any.whl.metadata (5.4 kB)
Collecting ruamel.yaml.clib>=0.2.7 (from ruamel.yaml->netkan==1.0)
Using cached ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.metadata (2.2 kB)
Collecting attrs>=17.3.0 (from aiohttp<3.8.0,>=3.6.0->discord.py<=1.7.3,>=1.6.0->netkan==1.0)
Using cached attrs-24.2.0-py3-none-any.whl.metadata (11 kB)
Collecting chardet<5.0,>=2.0 (from aiohttp<3.8.0,>=3.6.0->discord.py<=1.7.3,>=1.6.0->netkan==1.0)
Downloading chardet-4.0.0-py2.py3-none-any.whl.metadata (3.5 kB)
Collecting multidict<7.0,>=4.5 (from aiohttp<3.8.0,>=3.6.0->discord.py<=1.7.3,>=1.6.0->netkan==1.0)
Downloading multidict-6.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (5.0 kB)
Collecting async-timeout<4.0,>=3.0 (from aiohttp<3.8.0,>=3.6.0->discord.py<=1.7.3,>=1.6.0->netkan==1.0)
Downloading async_timeout-3.0.1-py3-none-any.whl.metadata (4.0 kB)
Collecting yarl<2.0,>=1.0 (from aiohttp<3.8.0,>=3.6.0->discord.py<=1.7.3,>=1.6.0->netkan==1.0)
Downloading yarl-1.11.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (48 kB)
Collecting smmap<6,>=3.0.1 (from gitdb<5,>=4.0.1->gitpython->netkan==1.0)
Using cached smmap-5.0.1-py3-none-any.whl.metadata (4.3 kB)
Collecting jsonpointer>=1.9 (from jsonpatch>=0.4->internetarchive!=3.0.1->netkan==1.0)
Downloading jsonpointer-3.0.0-py2.py3-none-any.whl.metadata (2.3 kB)
Collecting cryptography>=3.4.0 (from pyjwt[crypto]>=2.4.0->PyGithub->netkan==1.0)
Using cached cryptography-43.0.1-cp39-abi3-manylinux_2_28_x86_64.whl.metadata (5.4 kB)
Collecting cffi>=1.4.1 (from pynacl>=1.4.0->PyGithub->netkan==1.0)
Using cached cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.5 kB)
Collecting wrapt<2,>=1.10 (from Deprecated->PyGithub->netkan==1.0)
Downloading wrapt-1.16.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB)
Collecting pycparser (from cffi>=1.4.1->pynacl>=1.4.0->PyGithub->netkan==1.0)
Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Downloading discord.py-1.7.3-py3-none-any.whl (786 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 786.7/786.7 kB 17.6 MB/s eta 0:00:00
Downloading gunicorn-23.0.0-py3-none-any.whl (85 kB)
Downloading internetarchive-4.1.0-py3-none-any.whl (97 kB)
Downloading python_dateutil-2.8.0-py2.py3-none-any.whl (226 kB)
Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Downloading boto3-1.35.22-py3-none-any.whl (139 kB)
Using cached click-8.1.7-py3-none-any.whl (97 kB)
Downloading flask-3.0.3-py3-none-any.whl (101 kB)
Using cached jinja2-3.1.4-py3-none-any.whl (133 kB)
Using cached GitPython-3.1.43-py3-none-any.whl (207 kB)
Downloading PyGithub-2.4.0-py3-none-any.whl (362 kB)
Downloading pynamodb-6.0.1-py3-none-any.whl (61 kB)
Using cached ruamel.yaml-0.18.6-py3-none-any.whl (117 kB)
Downloading blinker-1.8.2-py3-none-any.whl (9.5 kB)
Downloading botocore-1.35.22-py3-none-any.whl (12.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.6/12.6 MB 84.1 MB/s eta 0:00:00
Using cached certifi-2024.8.30-py3-none-any.whl (167 kB)
Using cached charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141 kB)
Using cached gitdb-4.0.11-py3-none-any.whl (62 kB)
Downloading idna-3.10-py3-none-any.whl (70 kB)
Downloading itsdangerous-2.2.0-py3-none-any.whl (16 kB)
Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)
Downloading jsonpatch-1.33-py2.py3-none-any.whl (12 kB)
Using cached MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (28 kB)
Downloading PyJWT-2.9.0-py3-none-any.whl (22 kB)
Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 kB 25.3 MB/s eta 0:00:00
Using cached ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (734 kB)
Downloading s3transfer-0.10.2-py3-none-any.whl (82 kB)
Downloading schema-0.7.7-py2.py3-none-any.whl (18 kB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using cached tqdm-4.66.5-py3-none-any.whl (78 kB)
Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Downloading urllib3-2.2.3-py3-none-any.whl (126 kB)
Downloading werkzeug-3.0.4-py3-none-any.whl (227 kB)
Downloading Deprecated-1.2.14-py2.py3-none-any.whl (9.6 kB)
Using cached packaging-24.1-py3-none-any.whl (53 kB)
Downloading async_timeout-3.0.1-py3-none-any.whl (8.2 kB)
Using cached attrs-24.2.0-py3-none-any.whl (63 kB)
Using cached cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479 kB)
Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
Using cached cryptography-43.0.1-cp39-abi3-manylinux_2_28_x86_64.whl (4.0 MB)
Downloading jsonpointer-3.0.0-py2.py3-none-any.whl (7.6 kB)
Downloading multidict-6.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (131 kB)
Using cached smmap-5.0.1-py3-none-any.whl (24 kB)
Downloading wrapt-1.16.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (87 kB)
Downloading yarl-1.11.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (489 kB)
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Building wheels for collected packages: netkan, aiohttp, docopt
Building wheel for netkan (pyproject.toml) ... done
Created wheel for netkan: filename=netkan-1.0-py3-none-any.whl size=58772 sha256=b69b3e04416a74347868fa34ca1230301ab915ccf840aaf7816ce63a4ab1f403
Stored in directory: /tmp/pip-ephem-wheel-cache-kkpabxec/wheels/62/25/32/42027b3e465506f171583a064b5c47e56145d2ab5b3a2baa46
Building wheel for aiohttp (pyproject.toml) ... done
Created wheel for aiohttp: filename=aiohttp-3.7.4.post0-py3-none-any.whl size=451921 sha256=9cf65a467c0644c3d28a062d3e8304e050c465c563c3272dc4315bfa8b93ebed
Stored in directory: /home/leon/.cache/pip/wheels/f2/cf/b0/d8bcd12df975d67feaa74b0c2099280cc4c735fca9843c47b7
Building wheel for docopt (pyproject.toml) ... done
Created wheel for docopt: filename=docopt-0.6.2-py2.py3-none-any.whl size=13706 sha256=ca06a373a45032ee8457fae0d6628563fbbf5548ea87da173bab240d3bb491bf
Stored in directory: /home/leon/.cache/pip/wheels/1a/bf/a1/4cee4f7678c68c5875ca89eaccf460593539805c3906722228
Successfully built netkan aiohttp docopt
Installing collected packages: schema, docopt, wrapt, urllib3, typing-extensions, tqdm, smmap, six, ruamel.yaml.clib, pyjwt, pycparser, packaging, multidict, MarkupSafe, jsonpointer, jmespath, itsdangerous, idna, click, charset-normalizer, chardet, certifi, blinker, attrs, async-timeout, yarl, Werkzeug, ruamel.yaml, requests, python-dateutil, jsonpatch, jinja2, gunicorn, gitdb, Deprecated, cffi, pynacl, internetarchive, gitpython, flask, cryptography, botocore, aiohttp, s3transfer, pynamodb, discord.py, PyGithub, boto3, netkan
Successfully installed Deprecated-1.2.14 MarkupSafe-2.1.5 PyGithub-2.4.0 Werkzeug-3.0.4 aiohttp-3.7.4.post0 async-timeout-3.0.1 attrs-24.2.0 blinker-1.8.2 boto3-1.35.22 botocore-1.35.22 certifi-2024.8.30 cffi-1.17.1 chardet-4.0.0 charset-normalizer-3.3.2 click-8.1.7 cryptography-43.0.1 discord.py-1.7.3 docopt-0.6.2 flask-3.0.3 gitdb-4.0.11 gitpython-3.1.43 gunicorn-23.0.0 idna-3.10 internetarchive-4.1.0 itsdangerous-2.2.0 jinja2-3.1.4 jmespath-1.0.1 jsonpatch-1.33 jsonpointer-3.0.0 multidict-6.1.0 netkan-1.0 packaging-24.1 pycparser-2.22 pyjwt-2.9.0 pynacl-1.5.0 pynamodb-6.0.1 python-dateutil-2.8.0 requests-2.32.3 ruamel.yaml-0.18.6 ruamel.yaml.clib-0.2.8 s3transfer-0.10.2 schema-0.7.7 six-1.16.0 smmap-5.0.1 tqdm-4.66.5 typing-extensions-4.12.2 urllib3-2.2.3 wrapt-1.16.0 yarl-1.11.1
(venv) ➜ xkan netkan --help
Usage: netkan [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
analyze-mod Autogenerate a mod's .netkan properties
auto-freezer Submit or update a PR freezing idle mods
clean-cache Purge old downloads from the bot's download cache
download-counter Update download counts in a given repo
dump-status Print the mod status JSON
export-status-s3 Update the JSON status file on s3
indexer The Indexer service
mirror-purge-epochs Remove epoch strings from archive.org entries
mirrorer The Mirrorer service
recover-status-timestamps Set status timestamps based on git repo
redeploy-service Update and restart one of the bot's containers
restore-status Normalize status database entries
scheduler The Scheduler service
spacedock-adder The SpaceDockAdder service
ticket-closer Close inactive issues on GitHub |
Alright, probably something weird with my Docker. I did purge all my idle containers and images at some point, so maybe it's trying to access a purged dependency and doesn't understand it needs to regenerate it? 🤷 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the modernization! We'll catch up with the 🐍 coding standards yet!
This PR contains the following changes
AS
preferred overas
Verification of the changes has yet to be done, but the tests pass!