Poetry

OpenBSD 7.4 DevBox

OpenBSD 7.4 … will be released next week (23. Oct 2023). Why not have a look at the upcomming OS and prepare a VM for Software Development ? Preparation grab a fresh VM and Install OpenBSD 7.4 os version puffy74# sysctl kern.version kern.version=OpenBSD 7.4 (GENERIC.MP) #1396: Sun Oct 8 09:20:40 MDT 2023 [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP empty vm puffy74# pkg_info quirks-6.159 exceptions to pkg_add rules and cache add go, rust, python puffy74# pkg_add go rust python3 quirks-6.

Poetry Packages

Let’s play with Packages and Libraries References Python Modules Poetry Scripts Switch to Root Folder cd /some/path/you/want Create a new Package poetry new mypackage add some libraries poetry add requests … add some code … cat << 'EOF' > mypackage/__init__.py print("importing", __name__) EOF cat << 'EOF' > mypackage/main.py print("importing", __name__) def test1(): print("test1") def test2(name: str): print("hello", name) def test3(name: str, age:int): print(f"Hello {name} at age {age}") if __name__ == "__main__": print("This is a Library or Package.

Little Mail Validator in Python

wrote a little Mail Adresse Validator in Python. use it, modify it, like it … best practice for python is to use a virtual env like Poetry (or virtualenv) and add the “email-validator” module like this: poetry add email-validator Code few lines of code … #!/usr/bin/env python3 from email_validator import validate_email, EmailNotValidError ok=[] nok=[] emails = [ "[email protected]", "[email protected]", "[email protected]", "[email protected]", "asf.asdf", "[email protected]", "[email protected]" ] print ("\nMy Little Mail Validator\n") for email in emails: try: # Validate.

Poetry

1. Intro Poetry is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. Links https://python-poetry.org/ https://www.infoworld.com/article/3527850/how-to-manage-python-projects-with-poetry.html Install on OpenBSD Wanna Install on OpenBSD ? # get root doas su - Install as Root # Install Poetry pip3 install --user poetry # Update Poetry pip3 install poetry -U # Update Profile cat << EOF >> ~/.