Skip to content

2023-06-11 Sunday

python to JS?

saw you can make wasm with python https://github.com/pyodide/pyodide. actually it’s a python interpreter in the browser

they’re introducing wasm in python. it’s not ga https://github.com/python/cpython/blob/main/Tools/wasm/README.md

deploy mkdocs with github actions?

yes but it failed because my packages are so old https://github.com/marketplace/actions/deploy-mkdocs

can I just do this in the browser?

yes, and the easiest way is codespaces https://docs.github.com/en/codespaces

although they cost money it’s not a lot

upgrading pip packages

I tried to upgrade my requirements.txt with a sed expressoin and it didn’t work wiht the sed on GH workspaces so I just did it manually. I got it here https://stackoverflow.com/a/60788102/5568528

although pip-upgrader looks cool https://github.com/simion/pip-upgrader but the repo recommends poetry https://python-poetry.org/

running makedocs

https://www.mkdocs.org/getting-started/

makedocs serve

it looks like you can by using the TOC on the rop righthand side of the pages

I’m not sure if it will take you to that part because my page isn’t long enough

it looks like it though

how can I update my requirements.txt?

I ran a pip freeze and the output is long. I’m going to try poetry

# install 
curl -sSL https://install.python-poetry.org | python3 -

https://python-poetry.org/docs/basic-usage/#initialising-a-pre-existing-project

@sblack4 ➜ /workspaces/sblack4.github.io (master) $ poetry init

This command will guide you through creating your pyproject.toml config.

Package name [sblack4.github.io]:  
Version [0.1.0]:  
Description []:  sblack4's github.io site
Author [Steven B <genseb7@gmail.com>, n to skip]:  
License []:  
Compatible Python versions [^3.10]:  

Would you like to define your main dependencies interactively? (yes/no) [yes] yes
You can specify a package in the following forms:
  - A single name (requests): this will search for matches on PyPI
  - A name and a constraint (requests@^2.23.0)
  - A git url (git+https://github.com/python-poetry/poetry.git)
  - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)
  - A file path (../my-package/my-package.whl)
  - A directory (../my-package/)
  - A url (https://example.com/packages/my-package-0.1.0.tar.gz)

Package to add or search for (leave blank to skip):

lol no I’m lazy

how do I go from pip to poetry with minimal effort?

cat requirements.txt | xargs poetry add