Skip to content

Instantly share code, notes, and snippets.

@jugmac00
jugmac00 / gist:ebfba2234fe059b293086bb76177adfe
Created November 7, 2020 09:05
error compiling python 3.9
❯ ./configure --with-pydebug --enable-shared
❯ make -j2 -s
Python build finished successfully!
❯ ./python
./python: error while loading shared libraries: libpython3.9d.so.1.0: cannot open shared object file: No such file or directory
This is reproducible on Linux (Ubuntu 18.04) with the `enable-shared` option.
tox on  rewrite [$?] via 🐍 v2.7.17
❯ tox4 -r -e flake8
flake8: remove tox env folder /home/jugmac00/Projects/tox/.tox/4/flake8
flake8: install_deps> python -I -m pip install flake8-bugbear==20.11.1 flake8-comprehensions==3.3.1 flake8-pytest-style==1.3 flake8-spellcheck==0.23 flake8-unused-arguments==0.0.6 flake8==3.8.4
flake8: commands[0]> flake8 src tests docs
src/tox/pytest.py:66:1: PT004 fixture 'ensure_logging_framework_not_altered' does not return anything, add leading underscore
src/tox/pytest.py:111:1: PT004 fixture 'check_os_environ_stable' does not return anything, add leading underscore
src/tox/pytest.py:118:1: PT004 fixture 'no_color' does not return anything, add leading underscore
src/tox/pytest.py:274:1: PT004 fixture 'enable_pep517_backend_coverage' does not return anything, add leading underscore
src/tox/pytest.py:565:1: PT005 fixture '_invalid_index_fake_port' returns a value, remove leading underscore
# pi_approx.py
from math import pi
def approximate_pi(iteration_count: int) -> float:
sign, result = 1, 0.0
for at in range(iteration_count):
result += sign / (2 * at + 1)
sign *= -1
return result * 4
@jugmac00
jugmac00 / a_run.py
Last active December 14, 2021 08:51
pluggy - different signature problem
# packages is a list of packages, created from the configuration object (config.job.packages),
# but also external plugins can extend this list
# so I need something like this here
packages = list(itertools.chain(*pm.hook.lpcraft_install_packages()))
packages_cmd = ["apt", "install", "-y"] + packages
emit.progress("Installing system packages")
with emit.open_stream(f"Running {packages_cmd}") as stream:
proc = instance.execute_run(
@jugmac00
jugmac00 / main.py
Last active July 21, 2022 17:20
get some infos about the PPas of a team
"""
Usage:
- create and activate a virtual env
- `pip install launchpadlib`
- run `python main.py https://launchpad.net/~deadsnakes`
API:
https://launchpad.net/+apidoc/devel.html