#tools-and-devops

1 messages · Page 7 of 1

vapid fox
#

So:

  • If you're looking to just get it over with, Azure
  • If you need deep manipulation into infrastructure, AWS
  • GCP if not applicable
    ?
mystic void
#

it depends

#

if I was a tech startup, I would go with GCP or AWS

vapid fox
#

Student credits
Already burned it before working on some weird stuffs

mystic void
#

if I am a F500, then azure may come into play

#

but at the end of the day, each one has a somewhat equivalent service named differently

vapid fox
#

So now I just do the ol' free trial jenkery

mystic void
#

so potato potatoes

vapid fox
#

I still find Azure a bit more intuitive than GCP in terms of initial setup

#

I'll keep the platforms in mind, though for my applications I think my nugget homeserver will do fine

mystic void
#

docker/podman compose can get you pretty far in your home setup

vapid fox
#

Ah, docker. I'll touch Docker a bit later

mystic void
#

it's a great tool to learn

vapid fox
#

Been wanting to touch it for a while, but I keep getting sidetracked

mystic void
#

I would prioritize it over aws/gcp/azure

weak kindle
#

Hello guys

#

Need little bit help w GitHub actions

weak kindle
#

@abstract arrow

#

@mystic void

abstract arrow
#

please don't ping random people for help

rapid sparrow
# weak kindle Need little bit help w GitHub actions

#career-advice message

Hello user. Recommending to read dontasktoask.com and nohello.net and https://pythondiscord.com/pages/resources/guides/asking-good-questions/. You are making a common mistake in asking to ask instead of asking a question itself and therefore u will not get help. Also better to ask it in tools-and-devops
Already told you before. We can't help you because u don't ask your question with provided code examples, expected results, what u wished to achieve.

weak kindle
#

so i was trying to use the git-hub actions workflow to merge 2 branches when some changes is done to one branch it should auto merge it to the other branch i tried it and it triggers the event but it doesn't merge it

rapid sparrow
#

github workflows aren't meant for git commit pushing

#

exception, in special situations when using repository as an infrastructure like in upptime application

weak kindle
idle depot
#

hey serverless devs !

Which is better, Serverless Framework or AWS CDK ?
Why?

heavy knot
#

Hi

#

Any ideea how to add an external theme in vscode linux?

#

Like, i found the ~/.vscode-oss/extensions path

#

But where to put the theme here

#

?

white anvil
#

is there a way to customize the wheel filename created when using poetry build or pip wheel?

lethal mantle
#

god I hope not

flat path
short peak
#

hello. This is my scenario in a kubernetes cluster:

  • I have a Django application where most of pods have one replica
  • Only the actual application (WSGI) has multiple replicas
  • I have two nodes
  • I want any pod to be evenly spread, not just matching pods

I'm already checking "Pod Topology Spread Constraints". Is there any trick for this?

rapid sparrow
short peak
rapid sparrow
#

you are supposed to apply it per Deployment/Replica/Pod object

#

technically nothing prevents you applying it... almost globally through the usage of helm/templating stuff. U would be needing just to insert reusable stuff

short peak
#

ok. I think I'm on the right path, just missing that selector trick to ensure any non-system pod is spread without manually specifying labels

#

though I could, perhaps is easier to tag all of them

rugged copper
#

Hey everyone,

I am looking for a tool for performance/requests tracing of API backend. I've done messy poc with opentelemetry and jaeger, but not sure if it has functionality I need.

My short term use case:

  • I want spin up backend with tracing enabled, send some requests (basically happy path user flow) - then I want to dig into details and see eg external http requests aggregated by their url. This way I can easily spot that external request A is made 10 times instead of expected

Jaeger so far provides me with nice overview of each call to API, but I failed to see any kind of aggregation of repeating requests to external services (eg, show me all /external_resource requests, and which part of app called them). Also, it seems that opentelemetry does not capture body of http requests

so looking for something relatively easy to set up (elastic stack would be an overkill), that can be set up locally and that has possibility to aggregate all outgoing requests from the app

If anyone knows if it is possible to configure opentelemetry&jaeger to achieve that, I would also be greatful

mild hinge
#

I created a docker container for dev purposes, and I am using PIL within it, however when I do img.show(), no image is shown. This isn't really a surprise. I assume that in order to get to see the image I would need to map a port to the host. Anyone know what port, or how else I could do this?

rapid sparrow
#

(which url is opened)

mild hinge
rapid sparrow
#

how

#

in which program

mild hinge
#

It simply runs in the shell, I connected to the shell with docker exec -it container sh

#

I'm very early in my project, I'm just setting things.

rapid sparrow
mild hinge
rapid sparrow
#

(i give up trying to understand what you have at the moment)

#

you aren't able to explain what is your current output format. To where picture is exported / rendered / saved / from where you expect it to see

mild hinge
rapid sparrow
#

Docker can easily... have.. shared volume(folder) between running container and host

#

just a matter of simplle argument. So the first thing is easy to have

#

the second, forwarding signal from container to host GUI for automated picture showing? i have honestly no idea how, except knowing it is probably possible. But it is advance shit beyond my understanding. (and beyond average docker usage too)

#

I can offer you only -> remake your code rendering picture at simple URL adress (respond with Flask endpoint for example), then forwarding port for seeing picture in browser is simple

#

or just become satisfied with receiving picture to the folder where you activated container

#

Docker is for CLI/web applications, not for Desktop/GUI applications essentially. It is possible to hack it for Desktop application usage, but it is very advance shit beyond its intended usage.

mild hinge
rapid sparrow
#

docker run -v $(pwd)/folder:/path_to_docker container
or do same at the level docker-compose

mild hinge
#

That is already the case. In order to save your code when your developing you kinda need to do that anyways.

fossil temple
#

Been trying to connect https://vscode.dev to my vps either through vscodes tunnel feature or with ssh, the latter is not possible due to terminal and extension limitations on the web client (which is exactly why i want to connect to my vps, so i can use a terminal and run code through the web client without having to pay for github codespaces). A tunnel was my last option, but I've been running into an error when running code tunnel on my vps cli about snap for ubuntu, did some research and I only found one person that had the same error as me, it was an open issue at vscodes repo, it was unanswered.....

So if anyone here that might know how I can go about this, then I would really appreciate some suggestions!

(i've posted in #editors-ides too because it's quite a mix between that and this topic)

fossil temple
#

Haven't been able to find a single solution to this... pretty weird, I might actually create a project on this in the future for the sake of being able to stay in the web and connect to your vps and develop with vscode

#

oddly enough, that's not possible as of today based on my 3-4 hours of research lol

thorn portal
#

I am about to board a plane so I can't help further, but I suggest you Google "X11 forwarding docker" to make any GUI software work even when ran behind docker. @mild hinge

I have made it work correctly before so it's definitely possible.

eager rose
#

this is not an off topic channel lol

#

!off-topic

rancid schoonerBOT
nocturne palm
#

sry

devout lodge
#

Anyone aware of any tools similar to twine which lets you upload distributions to multiple pypi indices in a single command ?
twine only uploads to a single index
I'm looking for tools that uploads dists to multiple pypi indices

vapid haven
#

Can anyone here help me linking my modules on windows to an Odoo container? I've tried mounting the first folder on a second on the container, but it doesn't recognize the first

warped topaz
#

does anyone know if there's a python module with a ton of different TTS voices? the ones I can find only have around two or three

vapid fox
#

In theory I should be able to drop pylint and isort altogether if I switch to ruff, right?

#

Eh, I suppose can I refactor the thing to elif

heavy knot
#

AndyFluffing — Idag 19:16
Hello. Can someone tell me how I can send an email with python-code on a rpi? I used to do it with a gmail-account, but google changed something that closed that door.

sour canopy
#

Hi,
Does anyone ever build a slack bot using python?

sullen remnant
#

Hello, do you might know why i can t install using this method " pip install -r requirements.txt "

broken matrix
sullen remnant
#

ok i will try

idle trellis
#

has anyone tried replit for coding, now we can also perform coding on chromebook through replit

stuck badger
fervent ledge
#

hi everyone, i need your help, i'm using python 3.11 and i want to use pyserial but it sends me back this error , although pyserial 3.5 is installed on my computer

#

Traceback (most recent call last):
File "c:\Users\HP USER\Downloads\Monty-Python\import serial.py", line 1, in <module>
import serial
ModuleNotFoundError: No module named 'serial'

thorny shell
#

!dashmpip

rancid schoonerBOT
#
Install packages with `python -m pip`

When trying to install a package via pip, it's recommended to invoke pip as a module: python -m pip install your_package.

Why would we use python -m pip instead of pip?
Invoking pip as a module ensures you know which pip you're using. This is helpful if you have multiple Python versions. You always know which Python version you're installing packages to.

Note
The exact python command you invoke can vary. It may be python3 or py, ensure it's correct for your system.

north mulch
#

hi! I have a list of swear words to use on my website. But I need the words in this format >>

swear_words = ["d@mn", "h@ll", "cr@p", "d@rn", "p@ss"]

Are there any tools to convert those 1 word per line text into something like this?

rapid sparrow
north mulch
rapid sparrow
#

Failed to understand your question then, I thought u meant finding them already at target

north mulch
#

ahh...

earnest forum
indigo zenith
fossil temple
#

read the second sentence in my message

earnest forum
floral smelt
#

So I'm trying to set up an Azure pipeline with Poetry but it can't recognize it at the next script

#

I want poetry to be at least available for testing + coverage + code quality in separate steps

thorny shell
#

you'll have to write a command to install it

#

you can expect to have python and pip available, but not 3rd-party stuff like poetry

sharp saffron
#

is anyone familiar with the numerical shooting method for higher order boundary value problems?

#

i understand its essentially a guess and check method but im fuzzy on the details for python implementation

clear wigeon
#

Does anyone know a tool or code that runs a command through CMD as administrator?

#

Instead of just doing it myself

paper kayak
#

can someone help me figure out whats causing this error?

python: can't open file '/app/main.py': [Errno 2] No such file or directory

I can run my docker container from the dev machine but once I pull the image into unraid Im getting that error in the logs.

I am able to confirm main.py is included in the image at that directory

fleet portal
#

anyone know of a scheduler other than apscheduler ? I'm struggling to get it installed on an ARM device, but do not want a cron job ( a system dependency )

rapid sparrow
fleet portal
#

@rapid sparrow thanks, looked at celery beats... we are currently using it somewhere else, but I thought I will write my own scheduler... as to avoid dependencies on an ARM edge device

wary tartan
#

when using tkinter ive been using the insert function on text blocks, but problem is when i use the insert function the text inserted into the text box isnt visible.

#

what i mean by this is

#

theres this text box im using

#

i enter text inside of it and click enter, ive made it so when i click enter some text gets inserted into it, the text is correctly inserted but its not visible

#

i have to click left arrow key in order to see it

#

any idea how i can make it so when i use the insert function the text i insert in the text box is directly visible ?

dusky glacier
#

hey i have no clue if this is the right place but im currently trying to make a programs that you can run via the right click menu in windows explore.
i have added it to the right click menu using regedit but im getting this error from windows and its not running the script. and here the key thing im using to run the script

proper nimbus
#

That may be enabled

#

I've seen it enabled by default on some laptops

placid saddle
woeful wagon
#

I am using GitHub and I am in a team with a repository that has the main and develop branch protected. I have merged several changes to the develop branch. I now want to merge the develop branch into the master branch, however, there is a merge conflict between develop and master. How would I resolve this issue?

rapid sparrow
#

and while standing in this developed branch

#

git merge master

#

resolve conflicts (i usually do it with vscode

#

push commits, problem solved

woeful wagon
# rapid sparrow push commits, problem solved

I've tried that in pycharm, but for some reason that has not fixed the issue because when I submit the commits to develop branch via a PR, I still get that there is a conflict between develop and master

#

feel free to @ me

rapid sparrow
# woeful wagon I've tried that in pycharm, but for some reason that has not fixed the issue bec...

git checkout developed_branch_name // changing to developed branch
git fetch origin master:master // pulling latest master commits to master
git merge master // merging master to developed branch
solve merging conflicts (using pycharm tools / or kdiff3 / or vscode, whatever) / probably will require to finish it with git commit -m "merge: solved" once you finished. check with git status to verify it is resolved
git push // push developed branch commits with resolved commits to conclude it

woeful wagon
steel quail
#

hello hello, not sure it's the right channel, but I was wondering:

when I do

pip install numpy==1.23.4

for example, how does pip detects, among all the available wheels in the pypi index, what is the correct one for 1.23.4 ? is it a naming convention or does it perform a kind of operation, or does the wheel can be queried to get the version?

shadow bear
#

How is flet for Android dev?

pure mortar
#

hi i need help

echo nimbus
#

Hello, I need some ideas for pentesting features or tasks I will implement in my mutlipurpose cybersecrurity tool please

rancid schoonerBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

echo nimbus
sly sleet
#

yes

#

unfortunately many pentesting tools can be used for malicious purposes whether intended or not

echo nimbus
#

should I use setuptools for a tool made for linux? Or there is a better way to make an installation for my tool on linux?

echo nimbus
#

I want it to be fully integrated with the linux system, like when I type in the terminal:
myToolName
it should turn blue and be accessible from anywhere in the system

rapid sparrow
# echo nimbus I want it to be fully integrated with the linux system, like when I type in the ...

can't say for python ecosystem regarding different ways for installing.
But i can say, that if you want it globally accessable you have at least two ways

  1. using pip to install it globally
  2. compile to binary and add application binary to any Linux folder with binaries mentioned in $PATH (installing process can be just ln -s source_path folder_wtih_binaries_path through soft symlinks, or through wget/curl to users then)

both versions are kind of reliable, with second way more reliable to have accessability for linux than first one

echo nimbus
rapid sparrow
#

so pip install docker-compose

#

and it becomes available as docker-compose --arguments globally without python3 writing in its invocation

#

or ansible-playbook contains the same

#

i remember briefly somewhere reading about it

rapid sparrow
#

i think i remember it is setup somewhere at the level of some kind of setup file

rapid sparrow
#

together with using argparse or click for interface, you can make nice hooked interface

vagrant shell
# echo nimbus thanks this is helpful

and installation wise, pipx allows installing package as "global" but wont cause issues with other python tools that might have conflicting dependencies ..

outer sparrow
echo nimbus
#

Is it better for a cybersecurity tool to be menu based or like this:
myTool --option1 xyz
myTool --option2 xyz
etc ?

sly sleet
#

check out shebangs

#

setuptools entry_points -> console_scripts should do this for you

inner rose
#

Okay so I saw this thing on github and figured looking on discord would be a good place to go

#

And it says using python you can get cou s for yourself

#

And I'm not sure how to get it to work

quick sparrow
#

hey, in git merging from develop branch do main branch, would you rather opt for feat(develop): merge branch or feat: merge develop branch ?

#

taking into account conventional commits

rapid sparrow
rapid sparrow
#

Because merge is not a feature according to conventional commits

quick sparrow
quick sparrow
#

for future merges, should i end the commit message like v2, v3... ?

#

since i'm not using release tags

rapid sparrow
#

Just on regular git tool capabilities

rapid sparrow
#

With also generating changelog of changes of new features and bug fixes in markdown

sly sleet
rancid schoonerBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

undone topaz
#

I'm probably missing something obvious but I've run into one last stumbling block in migrating my project over to a proper pyproject.toml rather than setup.py/requirements.txt, in my toml for my dynamic version (I'm using Hatchling) I'm not sure what kind of path its expecting for [tool.hatch.version], I'm running py -m build from my project directory, my __init__.py which contains my __version__ is in my topmost module directory so:

my_project
┗╸__init__.py
pyproject.toml

Yet a simple:

[tool.hatch.version]
path = "my_project/__init__.py"

Isn't enough, if I want it to work I have to give it the entire absolute path for some reason.

open pivot
#

We are excited to be working on the open-source project,
https://github.com/promptslab/Promptify, which has been trending on GitHub and provides solutions to NLP problems using LLMs such as GPT, PaLM, etc.

We'd love to have like-minded contributors join us to discuss new features and core structures. If that sounds like you, please do reach out to us to get involved! 🙂

mossy gyro
#

I'm wondering if someone is available to have a convo with me about packaging a project. I have a few sequential questions. I'm more used to node things these days, and getting a little dizzy reading the python packaging docs with how many different tools and ways there are to make a package.

empty rover
mossy gyro
#

It's been forever since I made a python package. The official docs recommended using hatch, but hatch is kind of huge and there's no real tutorial, just reference docs.

  1. How do you set up a pypi package that has importable as well as CLI-executable functionality? Like, after a pip install, somebody could do $ myproject --some=arg for example, as well as from myproject import thing inside an app?

  2. What are best practices to define dependencies and install them? I'm using pipenv, which is kind of awesome, but I’m not sure if that's stepping on the toes of hatch. It’s kind of confusing to have to manage a Pipfile or even just a requirements.txt separately from the toml deps. I'm more used to node-style these days, where everything is defined in one place (the package* files). Like, the build system looks to that for people installing your package, but during dev, you also just npm i to install them in your local “env” (node_modules, not a venv) and use npx to run files using your env. Is there a hatch command to install the defined toml deps in a venv or local dir? Or do you just have to manage your requirements yourself during local dev, however you see fit, and then make sure you also include them in the toml when building and releasing?

  3. What’s the recommended loop for local dev in terms of running your app? Just have your venv set up and $ python path/to/my/script.py? Or is there a better suite of commands to run your project using the defined deps, like npx?

#

Sorry for the wall, and thanks in advance.

rapid sparrow
rapid sparrow
rapid sparrow
# mossy gyro It's been forever since I made a python package. The official docs recommended u...
  1. What’s the recommended loop for local dev in terms of running your app? Just have your venv set up and $ python path/to/my/script.py? Or is there a better suite of commands to run your project using the defined deps, like npx?
    in general poetry and... pyenv will cover all possible needs to run your application

pyenv = switches global python between versions quickly
poetry = will work like npm, and automatically create correct venv version and install stuff into it. poetry shell, poetry install. For running application it is still better using python3 path_to_your_script for dev env of course. But your should really get how works python packaging system in order to be good

mossy gyro
#

@rapid sparrow I went with poetry and it is WAY easier to learn and use than hatch, IMO. Thank you!

rapid sparrow
#

this ensures that your scripts will have access to same absolute import package_name.libs as any other files

#

no problems will be with importing during script runs, or during test runs then

#

python3 -m package_name, will launch code from __main__.py file btw in package_name

#

Basically, your python files should not need to have hacks in PYTHONPATH for their working 😆

willow pagoda
rapid sparrow
#

package is compiled/packaged result. it can be even not tested at all. preferably tested though, to ensure that during packaging important files did not went missing

willow pagoda
tardy crypt
#

Hello guys, moved from conda and pip to poetry few months ago and now my task is to create a simple package - before I was doing so with setup.py and stuff around it but now I'm like... wait, how should I create a package with poetry? Can you guys please help me out? ❤️ Thanks!

rapid sparrow
rapid sparrow
# tardy crypt Hello guys, moved from conda and pip to poetry few months ago and now my task is...
tardy crypt
rapid sparrow
#

read errors/ or provide errors to identify problem further

tardy crypt
#

yeah yeah ofc.. I just made a repo with all the code I needed, made setup.py and be like... oh wait... I use poetry now.. something is not right 😂

tardy crypt
dire canyon
#

Has anyone used ReadTheDocs? I have some general questions that can't be answered by their documentation.

willow pagoda
#

ive used it for one project and the main struggles i had was learning sphinx and realizing that the builddir had to be changed to _build for rtd to find it

dire canyon
#

@willow pagoda Thanks. I played around with their tutorial repo and am confused.

My questions assume I am in one Github repo with both project source code files and Sphinx/MkDocs documentation.

  1. RTD is just a builder/hoster for docs you've already created in Sphinx/MkDocs, correct? I.e., you work on both source code and documentation separately?
  2. If I change some source code file, maybe just add a comment, RTD rebuilds the entire documentation. Why? RTD can't read anything from the source code files, just the documentation, so why does it rebuild?
  3. Why does RTD talk about 'continuous CI/CD', like its somehow linked directly to your source code? If I change my source code drastically (method names, constructors, etc.), the documentation doesn't reflect any of that, right? I have to manually update the Sphinx/MkDocs files. The way the RTD guides are written, it seems like RTD does some automatic detection of code changes to update the corresponding documentation pieces, which I know it can't possibly do. Maybe I'm just overestimating it.

And lastly... can I have RTD documentation in a separate repo while having source code in its own? This is just cleaner to me. I am assuming the only reason RTD docs are kept in the same repo as source code is to automatically trigger build updates, but again, as source code and documentation are totally separate... why does it matter? You change code and then update the docs after... does RTD have some special ability I'm missing?

empty rover
dire canyon
#

@empty rover I see... so this is more of a Sphinx problem than an RTD problem for me. Because I was so confused by RTD's requirement to have your code open-source on a repo for the free version. I figured, if documentation is separate from code, why bother hosting code, just write the docs and host on RTD... but if Sphinx can do what you say... hmm.

willow pagoda
# dire canyon <@153551102443257856> Thanks. I played around with their tutorial repo and am co...

yup what hofmann said, sphinx has two built-in extensions for this
https://www.sphinx-doc.org/en/master/usage/quickstart.html#autodoc
https://www.sphinx-doc.org/en/master/usage/extensions/autosummary.html

  • sphinx.ext.autodoc provides directives that can expand themselves using docstrings from your code
  • sphinx.ext.autosummary provides the .. autosummary:: directive to generate .rst files using autodoc directives

enable them in your conf.py and write an .rst file with the appropriate directives to use them, for example:
https://github.com/thegamecracks/berconpy/blame/main/docs/source/conf.py
https://github.com/thegamecracks/berconpy/blob/main/docs/source/api.rst

#

and for stable you manually trigger a build whenever you want

dire canyon
willow pagoda
#

oh wait, stable also updates itself when you tag a commit with a semantic version that isnt a prerelease (as described in the last link)

dire canyon
#

Honestly for a documentation software, the documentation for RTD sucks lemon_angrysad

#

I feel like all my questions could be answered by an explicative diagram showing the workflow of an RTD project.

willow pagoda
#

for me i just had to read the bare minimum to get my docs hosted, but setting up the sphinx documentation beforehand took the most time

#

their tutorial's a decent start, and i'd summarize the workflow as bootstrap docs/, type some reST, run make html in docs/, view build/html/index.html, and repeat until it looks ready to push

dire canyon
#

thanks a lot. you've been a great help.

heavy knot
#

hey guys

#

i'm trying to clear my repo history on github cause it shows error while deploying it and it caused by the deleted file

#

Create a new branch with git checkout --orphan branch_name (the --orphan will make it have no parents and the root of the history, like the git init state).
Then delete your main branch, and rename your branch to main or master or whatever. Commit your code and push.

heavy knot
#

I do not have a youtube video (and I also personally do not recommend learning from videos), this is all just a short list of commands.
Do you know how to delete a branch?

#

alright can u guide me then

#

it is

#

a file that i added then i deleted

#

but it stuck in history and when i'm trying to deploy it just shows

#

error and it fail to deploy

#

Oh wait, do you want to delete all your history?

#

yeah

#

check it shows (Delete _redirects)

#

So first you should create a new orphan branch just git checkout --orphan branch_name
Then delete the main branch git branch -D main
rename your branch to main git branch -m main
and then you're set, you just have to commit and push

#

alr

#

You should you the cli for this

#

Are you on Windows?

#

i'm on ubuntu

#

Ok so open the terminal in the repository's directory

#

alr

#

i'm in

#

Open a new terminal in that directory pls

#

i did

#

Where is it?

#

it's in the hidden bar don't worry about it xd

#

Sure lol, so just execute the commands that I explained about earlier in the terminal, commit and push and then you're done.

#

alr let me try it sec

#

Sure

#

brench name is the name of the project right ?

#

Branch name is the name of the branch

#

xd

#

It's just a random name, you can pick any name (assuming you are talking about the name I picked branch_name)

#

ah got it

#

and what about branch main

#

That's just the default name for the main branch (master can be used as well) but since that's your default main branch of github there is no need to really change that

#

so now i just need to push it

#

Did you commit?

#

i did all commands u sent me

#

git checkout --orphan branch_name
git branch -D main
git branch -m main

#

I didn't send the commit command, but I guess you can use Github Desktop if it shows you the branch

heavy knot
#

i used master

#

and it worked

#

Didn't git branch -D main give you an error if you used master?

#

it gave me noth i guess

#

Deleted branch master (was e7bdfae).

#

this what it shows me

#

Oh okay, so just commit and push this

#

git commit -m "initial commit"
git push origin master

#

only !

#

forgot git add .

#

so i do it before commit !

heavy knot
#

alr

#

it shows an error

#

Send the error please

#

Oh interesting... Give me a second pls

#

alr

#

Just force it using -f

#

That worked for me

#

can u send me the full command

#

git push -uf origin master

#

i guess it's done

#

numerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 4 threads
Compressing objects: 100% (19/19), done.
Writing objects: 100% (21/21), 9.68 KiB | 9.68 MiB/s, done.
Total 21 (delta 1), reused 16 (delta 1), pack-reused 0
remote: Resolving deltas: 100% (1/1), done.
To https://github.com/dimensionthug/prewebsite.git

  • e7bdfae...068305a master -> master (forced update)
    Branch 'master' set up to track remote branch 'master' from 'origin'.
#

That means it worked, check it

#

here you're done

#

i guess it works

#

let me check

#

it still failed to deploy

#

idk why

#

Very interesting, why did it fail?

#

i have no idea

#

Maybe you have an error there or smth, check the logs

#

==============
Using Nixpacks

context: e1a981e64bc431acdf3663a2b7f2ae7b
Nixpacks build failed

Using subdirectory "wordcount"

Nixpacks was unable to generate a build plan for this app.
Please check the documentation for supported languages: https://nixpacks.com

The contents of the app directory are:

pycache/
wsgi.py
templates/
urls.py
settings.py
views.py
init.py
asgi.py

Showing 23 logs

#

this is the build logs

#

i guess i'll try to upload it in dif website

#

host

#

@heavy knot btw do u have any free host dynamic web

#

so i can test on

#

is good example

#

to try on

undone warren
willow pagoda
# heavy knot i guess i'll try to upload it in dif website

btw i believe the error message is explaining to you that your project structure isnt correctly organized, and that you should click the link they gave you and follow the guide for your language, i.e. python
https://nixpacks.com/docs/providers/python
probably a relevant part:

Python is detected if a main.py OR requirements.txt OR pyproject.toml file is found.
their message also seems to suggest it was looking inside wordcount/ rather than using manage.py

stone oar
#

Hi

#

Guys

heavy knot
#

this is all files i have inside wordcount

willow pagoda
#

if its just django and gunicorn (the webserver that nixpacks prefers apparently), your requirements.txt could be as simple as: Django gunicorn or if you want them locked to a specific version: Django==4.1.7 gunicorn==20.1.0

sacred cobalt
#
TOTAL                                                                                          9298   6260   2370    139  30.0%
report run-test: commands[2] | coverage html
/home/runner/work/autokey/autokey/.tox/report/lib/python3.7/site-packages/coverage/html.py:111: CoverageWarning: No contexts were measured
  self.coverage._warn("No contexts were measured")
Wrote HTML report to test_coverage_report_html/index.html
___________________________________ summary ____________________________________
  clean: commands succeeded
ERROR:   coverage: commands failed
  report: commands succeeded
Error: Process completed with exit code 1.
#

i was wondering if someone could explain if it can be ignored or what it means

vocal pewter
#

Your failure isn't with tox or coverage. You have a failing test.

vocal pewter
# sacred cobalt ```py TOTAL ...
=================================== FAILURES ===================================
_____________________ test_application_runs_without_errors _____________________

caplog = <_pytest.logging.LogCaptureFixture object at 0x7f39e6722090>

    @patch('autokey.dbus_service.AppService' , unittest.mock.MagicMock())
    @patch('sys.argv', ['autokey-app-testing'])
    def test_application_runs_without_errors(caplog):
>       subprocess.call(["xhost", "+SI:localuser:{}".format(os.environ.get('USER'))])

tests/UIs/test_headless.py:41: 
sacred cobalt
#

what i don't understand is why it fails if i fork with only master but works if fork with all branches

#

the first error was on their dev branch so that might be on them

#

but this fork one makes no sense to me

#

oh wait i think i see why now

#
>       assert_that(git_tag_version, is_(equal_to("v"+autokey.common.VERSION)),
        "Ensure the most recent git tag version matches the version number in lib/autokey/common.py")
E       AssertionError: Ensure the most recent git tag version matches the version number in lib/autokey/common.py
E       Expected: 'v0.96.0'
E            but: was ''

tests/test_common.py:38: AssertionError
#

@vocal pewter ok thanks, i'll focus on that first error. I mistakenly assumed they failed for the same reason.

vocal pewter
#

Good luck.

sacred cobalt
#

now you go me wondering if it's a nightmare issue

vocal pewter
#

I have no idea. :) I just looked at the CI output for a coverage error and found a pytest failure.

sacred cobalt
#

i clearly did not look well enough since it's right there to see. oh well. thanks gain

sacred cobalt
#

@vocal pewter apt install x11-xserver-utils fixed it.

heavy knot
willow pagoda
quick sparrow
#

hey, simple git question

#

in the description of merge commits, should i list the merged commits from oldest to most recent or the other way around? (top to bottom)

rapid sparrow
quick sparrow
#

i did, but i felt it was clearer for me to describe what actual commits are contained in that merge

#

i guess it just comes to personal preference, i feel i prefer it most recent to oldest but wondered if there was some common practice or anything

brazen forge
#

if you want to list commits anyway, you could do it like a changelog, use chronological order

jade ore
#

I want to make an Instagram auto mail collector I wonder how I can collect the e-mail of the account from the recommended ones of the account?

frigid depot
#

might not be the correct channel, but in matplotlib I am trying to plot a line graph but if there is no point next to it I want to plot it to 0.

finite fulcrum
#

How can I authenticate for a mirror using devpi? I'm trying to create a cache for a private index, but can't find how to authenticate into that index using devpi

graceful light
hushed sage
#

Hi guys can I get some help on how to build pc

stone oar
#

Hi Guys

willow pagoda
#

Is there an official way to install dependencies from pyproject.toml (setuptools backend) without installing the package itself? It'll be for docker to cache my dependencies before installing the source code itself. Although in reality it's a pure-python application organized as a package, so perhaps I should get rid of the installation metadata entirely and use a requirements.txt file...
My current workaround is using a short script to extract and install the dependencies manually.

rapid sparrow
willow pagoda
#

thats the workaround im doing

rapid sparrow
#

may be there is better way though

willow pagoda
#

mhm

rapid sparrow
#

somewhere in setuptools or smth

rapid sparrow
#

you can just install stuff with poetry

rapid sparrow
rapid sparrow
#

ergh. feel free to skip venv stuff i guess

#

poetry can specify which dependency groups to install, with --with --without smth arguments

willow pagoda
#

but i just want to use setuptools this time

rapid sparrow
# willow pagoda poetry's what i used in my first dockerfile, except i went with two separate ven...
FROM base as dev
RUN pip install poetry==1.2.2
COPY pyproject.toml poetry.lock ./
# RUN $POETRY_BIN config --local virtualenvs.create false # do we need it?
# RUN $POETRY_BIN install --no-root

FROM dev as pre-prod
RUN poetry export --without-hashes --format=requirements.txt > requirements.txt

FROM python:3.10.5-slim-buster as prod
WORKDIR /code
COPY --from=pre-prod /code/requirements.txt ./
RUN pip install -r requirements.txt

original file from here https://github.com/darklab8/darklab_article_docker_python/blob/master/example_frm_django/Dockerfile

#

oh yeah, u can use poetry to extract to requirements.txt file

willow pagoda
#

huh

tribal haven
#

Sorry about the long message, TL;DR I'm having trouble learning to use Hatch beyond what's in the documentation, does anyone have good resources or repos that use Hatch that I can look at?

Does anyone have much experience with Hatch (https://hatch.pypa.io/)? I'm using Poetry for my projects now, but I'd really like to try Hatch for a few projects. I specifically want to try it for building in a container with devops; I already use a Poetry Dockerfile very similar to the one @rapid sparrow posted a few messages up (actually, you helped me trim my version down a bit! 😄), but I'm having trouble wrapping my head around actually using Hatch.

I can't seem to grasp how Hatch handles dependencies and environments. With Poetry, I can install dev dependencies like Black so VSCode can autoformat on save; I created a "dev" env in Hatch, and it seems like it creates it successfully, but I'm wondering if I can use a combination of Hatch for environment management, and another tool for dependencies. Am I meant to install new dependencies by using Pip inside of Hatch?

Resources for learning are pretty sparse for Hatch, I've only found a couple of blog articles that were helpful, but I just feel like I don't fully understand the tool. I've read through the docs, which don't have many examples, or link to sections I feel are underdeveloped (like editing Hatch's config at ~/.config/hatch/config.toml), and it feels like there is a lot I should "just know" that I don't when I'm reading through the docs.

Any good learning resources, or repos where you've used Hatch that I can take a look to see how things are structured? 🙂

flat path
tribal haven
unreal hull
#

Hello everyone! I wonder what the best practice for release a Python project with GitHub workflow is. I'm trying not to push to main branch directly, so maybe creating a published release manually is the way to go? Normally after merging a pull request.

rapid sparrow
# unreal hull Hello everyone! I wonder what the best practice for release a Python project wit...
name: Build and distribute

on:
  release:
    types: [published]

jobs:
  ci-run:
    name: Run the Test suite
    uses: obfuscated/obfuscated/.github/workflows/ci.yml@master

  build-and-release:
    runs-on: ubuntu-latest
    needs: ci-run
    steps:
      - name: Set up Python
        uses: actions/setup-python@v2
      - uses: actions/checkout@v2
      - run: pip install wheel
      - run: |
          ref = "${{ github.ref }}"
          tag = ref.split('/').pop()
          print(f'::set-output name=tag::{tag}')
        shell: python
        id: tag
      - run: >
          python setup.py
          bdist_wheel
          --build-number ${{ github.run_number }}
        env:
          TRAVIS_TAG: ${{ steps.tag.outputs.tag }}
      - name: Get package name
        run: echo "::set-output name=package-name::$(python setup.py --name)"
        id: name
      - name: Copy to s3
        uses: prewk/s3-cp-action@v2
        with:
          aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          source: 'dist/'
          dest: 's3://obfuscated/${{ steps.name.outputs.package-name }}'
          flags: --recursive
          aws_region: eu-west-1

Ideally, you create only Release of product in Github, then automatically runs github workflow and deploys it

unreal hull
rapid sparrow
#

i made a tool for this

rapid sparrow
# unreal hull Thanks! I appreciate this process myself, but I wonder if there's a way to autom...

i mean u can use just something like auto generated version matching Github Action workflow run, but i made tool that automates following Semantic Versioning for product releases
https://github.com/darklab8/darklab_autogit

GitHub

Automated git conventional commits and semantic versioning - GitHub - darklab8/darklab_autogit: Automated git conventional commits and semantic versioning

#

scans git tags, and suggests next version based on present feat:, fix: commits

#

also generates changelog of new features and fixes

#

i usually make releases with running command autogit version --tag --push, it automatically generates next version, and pushes as git tag to remote

#

this tool also helps following git conventional commit standard to have better descriptions to git commits

#

friendly one file binary format for any OS and architecture 🙂 written in golang.

unreal hull
#

And I just discovered this tool, which seems to do the job, I guess

golden shuttle
#

I'm building a web crawler with selenium and I want to deploy it with selenium. Crawler is composed of two part, a chromedriver instance running in one container and my code who connect to running instance to process data. After trying to find a way to pass args to my code container via docker compose, I finally choose to just put var in .env file at build statement and use they are env vars in my program. So my python command to run crawler in dev is python -m mcrawler --use-env-vars. But when I use it in docker file, it seems --use-env-vars does not havec effect. This is my code in __main__.py and in Dockerfile. Thanks in advance if someone can help me.

naive stream
#

Might be a weird question, but anyone here knows how to put a custom SPS and PPS value on python library PYAV to decode an h264 stream? If I am wrong, what is the correct channel to ask the question?

primal tartan
#

I think this is the right channel but; I’m currently building a prototype game engine in python. It’s a side project, nothing special, just to learn game engine and game design. My issue is that I have working code but the speed/frame rate of the code overall isn’t the best. I’m aware that python isn’t great for speed but I know most of the lag comes from the graphics library I’m using, I’ve already started the process of switching to a diff graphics library. But my main question is there a way I can compile or convert the python code directly to C or another language that will be faster?

#

Primarily without having to add a bunch of none python code? Also if I desire to ship this demo to my discord server is there a way I can freeze this compilation using let’s say a compiler such as pypy?

rapid sparrow
primal tartan
#

My concern with cython is that do you have to add a bunch of extra code to make cython run?

#

Such as writing code to specify certain thing for each individual definition?

rapid sparrow
primal tartan
#

Thank you, I’ll look into compiling with cython without having to use those variables.

#

Also if I freeze the code into a single exe. Will that allow me to use the cython library?

rapid sparrow
primal tartan
#

So once it compiles does it create a standalone c code that I can run on its own? I know I should just read the documentation. Im just trying to see if this is worth the effort vs switching to another language

rapid sparrow
primal tartan
#

Ok so I think I’ll take a moment to look at how much further I want to prototype this engine. If I continue prototyping then switching to another language will be harder. So im thinking I should instead figure out what language I should be switching too instead and if switching is worth it. Thank you @rapid sparrow! I appreciate your insight!

rapid sparrow
mystic void
opaque juniper
#

How to write a python program to analyse the first captured frame of a PCAP file which is a DHCP protocol?

solemn osprey
#

Quick question, if I declare the same env variable in dockerfile and as a docker run flag, which one takes precedence?

rapid sparrow
tight igloo
#

Hey there! I'm am in a real bind at work. We develop some python applications that are deployed on an aarch64 embedded computer and we are really needing to implement CI/CD build pipelines for gitlab. Unfortunately, our infrastructure at my company is terribly unhelpful. We only have access to x86 servers for building and tools like docker buildx or docker in docker are just not viable options for cross compiling.

I need to do the following:

Create virtualenv
pip install -r requirements.txt
cd library-written-by-us
python3 setup.py install
pyinstaller myapp.py

And get a native aarch64 binary out of the project. This is very easy when done on a local aarch64 dev machine, but I need to do something like this on an x86 server in gitlab. What is the best approach for cross building our python application to aarch64 while making sure that all the dependencies in our requirements.txt match the platform as well? PLEASE any help or advice or experience would be supremely appreciated. I've tried many solutions but nothing is working in our cloud. Docker in Docker with buildx is a nonstarter because the infrastructure is such crap. I believe that doing the cross build in just a regular Ubuntu18.04 container is our best bet to make sure the pipeline works but I'm just stuck. Not a lot of discourse exists online surounding this topic that is particularly helpful. I've even consulted with chatGPT which suggests cross compiling python3.6 (our target version) and using qemu to run the aarch64 version of python and install all the deps. Is this the right approach or is there something better that I should be aware of. THANK YOU in advance

rapid sparrow
#

From my experience... Python cross platformness sucks and we could say not existent.

#

Best option going buildx

#

Perhaps to try WASM Docker.
And if both aren't available, then may be even using vagrant xD

#

AWS has arm64 instances, easier probably making runner already with arm64 onboard

#

Ergh, assuming u target arm64 of course

#

Aarch64 is not CPU architecture. It is only distro

#

If your CPU architecture match, u can just build on x86, resolving distro details at level of regilar containers

#

Using arch image as base or smth

tight igloo
#

Okay. This is what I feared. I'm probably going to have to go through the arduous and painful task of onboarding our native arm64 machine as a gitlab runner. Thank you for your input. If anyone else has any nuggets of hidden wisdom, please let me know.

I feel a bit betrayed that python doesn't have infrastructure in place for easier cross compilation. But maybe I'm just an asshole with expectations that are too damn high 🙃

rapid sparrow
# tight igloo Okay. This is what I feared. I'm probably going to have to go through the arduou...

As far as I searched this is decision made consciously by CPython developers.

If u wish cross platform run, then don't compile in CPython

Or use alternative python implementation like Cython. It should be having cross platform features perhaps. (Or Jython and etc)

In any way I just gave up and used Golang, it is cross compiled natively with single flag change to any OS/CPU architecture without any problems as long as u don't use CGO(even with CGO cross compiled though)

fallow storm
# tight igloo Hey there! I'm am in a real bind at work. We develop some python applications th...

You should be able to use cibuildwheel for this.

you can utilize one of the configuration settings here: https://cibuildwheel.readthedocs.io/en/stable/options/#repair-wheel-command to go from just making the internal dep into per-platform wheels to also handling pyinstaller.

docs on this provide the default as 'auditwheel repair -w {dest_dir} {wheel}' and point out that it is treated as a shell command, and explicitly note you can extend it with && whatever_else, or in your case, pyinstaller use.

weary coyote
#

Long shot but has anyone built any sort of slack scraper?

tight igloo
#

Thanks for the responses @rapid sparrow and @fallow storm. I'll check those out. I successfully compiled python3.6.9 for aarch64 earlier today. Weird thing though is that pyinstaller fails to install through pip because python3.7 or higher is required. This is weird, because the system we're targeting, the Nvidia Jetson Xavier NX, has python3.6.9 and install pyinstaller no problem. Even if I copy the wheels from the NX computer and try to install them, python rejects it because the package says python is out of date. Does anyone know how this can be if I am using literally the same version of python and it works on one machine and not the other?

arctic rose
#

whats the best way to handle docker and python libraries togethor

#

do you use venv and docker togethor?

#

cause both virtualize so are both of them needed? or can i just use docker?

#

but if i use docker how do i get the requirements file do i manually create it?

#

or is the docker container created first then everything is installed in there?

#

but then if i kill the container everything dies

arctic rose
#

cause if i use venv i can easily track the packages but is it necessary since we are using docker?

#

i just learnt docker and im trying to host an application so im trying to figure out the best way to do it 😅

thorny shell
#

I don't see any point to making a virtualenv inside a docker container

thorny shell
arctic rose
#

also i just found out poetry is it the same as venv?

thorny shell
#

that's the simplest way, sure

#

if I were you, I'd use as few fancy libraries as you can get away with, until you understand what you're doing

#

poetry is nice but it's sort of like trying to drive a semi-trailer, when you have never even driven a car

arctic rose
#

😂

#

so what is the car here?

thorny shell
#

python and pip

arctic rose
#

damn

#

aight thanx

rapid sparrow
rapid sparrow
arctic rose
#

venv

rapid sparrow
#

Venv is not dependency tracker

#

U can't do it with it

#

U can track dependencies with
requirements.txt, constraints.txt, pipenv and poetry

arctic rose
#

yes i use venv then pip freeze the results to a requirements.txt file

#

but i get what you are saying also i used to use venv because i use wsl and alot of packages do not install properly until i use venv

rapid sparrow
# arctic rose yes i use venv then `pip freeze` the results to a requirements.txt file

That is better answer, but essentially u do the most primitive dependency tracking, because u don't know what u need, and what are your main dependencies

Recommending as next step doing next thing

pip freeze > constraints.txt
Write into requirements.txt by hand main deps without version lock
Install as
pip install -r requirements.txt -c constraints.txt

#

Constraints file deps aren't installed, they lock stuff installed by requirements

rapid sparrow
arctic rose
#

im using wsl2

rapid sparrow
#

Then I don't get your problem. Docker image should be having easy time installing your deps without venv

#

What do u use as image basis?

arctic rose
#

yes i just learnt docker today

rapid sparrow
arctic rose
#

so i will try it wth itt today

arctic rose
arctic rose
#

or just python:3.8

rapid sparrow
#

Alpine is a pain

arctic rose
#

alright

rapid sparrow
#

Due to different C compiler and stuff

#

Also alpine has bug for some python version to compile/install stuff 50 times slower

arctic rose
#

damn thanx i will swicth it

#

👍

rigid sandal
#

What's devops

#

google doesn't have a clear answer

tepid fossil
#

Does anyone have experience setting up visual studio's c/c++ python debugger?
https://learn.microsoft.com/en-us/visualstudio/python/debugging-mixed-mode-c-cpp-python-in-visual-studio?view=vs-2022#enable-mixed-mode-debugging-in-a-cc-project

I got as far getting a python file to load and execute in my c++ but when I add the file to my project and set a breakpoint it gives me a symbol not loaded error.

rapid sparrow
# rigid sandal What's devops

Development, QA, Operations, Business. Long ago, the four business positions worked in silos, but everything changed when DevOps appeared.

Only the DevOps Avatar, master of all four positions, could unite them. But when the businesses needed it most, DevOps was just emerging.

Years passed, and DevOps became the bridge between the business positions of marketing, sales, finance, and operations. With the help of this modern practice, we could integrate these positions, create efficient workflows, and deliver business value quickly.

As DevOps practitioners, we are the catalyst for change, breaking down the barriers between the different business positions to ensure seamless collaboration and efficient delivery of high-quality products or services.

rapid sparrow
# rigid sandal What's devops

In reality, DevOps person usually deals with infrastructure as a code for web infra. Which speeds up development, makes faster getting feedback, documented as a code stuff, gets development approach to getting reliability, observability and etc in infrastructure

#

Basically DevOps people are software web devs which care about maintenance of a product usage in the most automated way, automating toil as much as possible

Common to adhere to those principles
https://12factor.net/

rapid sparrow
# rapid sparrow >>> Development, QA, Operations, Business. Long ago, the four business positions...

On a more philosophical side in entirely different termin meaning, DevOps is actually about making everyone care about other side of product development in order to receive better, faster product.
Ergh... There are two different things named DevOps, which happen to have same word by accident and HR fault
One of them means which stuff does DevOps engineer, second one describes DevOps as a culture in a company/team

wicked horizon
#

Guys is it possible regarding verson control to share without using git & github between 3 people

rapid sparrow
wicked horizon
#

When you work in a company you get github account from that company right?

#

And it could be gitlab or github or self hosted CLI git as you said

rapid sparrow
wicked horizon
#

Have you ever worked with junit or mockit testing tools

rapid sparrow
wicked horizon
#

I am only familiar with python unit testing
How is it different
Is it tough to learn?

rapid sparrow
#

static typed world is different one (python has typing too, but rarely who uses it)

#

otherwise, principles are you know, mostly same

wicked horizon
#

Is it necessary to learn i mean can i do the same job with python unit testing?

rapid sparrow
wicked horizon
#

Actually i am applying for a job and required skill is junit or mockit

rapid sparrow
# wicked horizon Ok thanks

Java unit testing can be done only in Java testing frameworks
Python unit testing can be done only in Python testing frameworks
End to end testing can be done in any testing framework for any other language (so you can e2e test java web app in python)
Technically possible to do even unit testing in cross language matter, but it is like using assemble language to write web application. Only most craziest people who value no time would do it (which will almost never happen in real life)

rapid sparrow
#

Spamming in several channels the same is bad

true grove
rapid sparrow
#

Yaml for the win

arctic rose
#

i am trying to connect my mongo db application to the python application

#

both are one the same network i added a netshoot container and checked just like they did in the docker docs

#

this is the connection in python

#

but when i go to this route

#

it gives me time out error as i does not connect

#

the error

#
docker run \
-w /app -p 80:80 \
-v "$(pwd):/app" \
--network todo-app --network-alias todo-py \
python:latest sh -c "pip install -r requirements.txt && uvicorn app.main:app --host 0.0.0.0 --port 80 --reload"

for spining up fastapi app

#
docker run \
-dp 2717:27017 \
--mount type=volume,src=todo-db,target=/data/db \
--network todo-app --network-alias mdb \
mongo

for spining up mongo container

#

im trying to do it without the username and password in mongo db

arctic rose
#

NVM I JUST RESTARTED ALL THE CONTAINERS AGAIN AND IT WORKS NOW

rigid sandal
#

does it require business knowledge

deep hill
#

why does python 12 lines of code take more cpu usage than many tabs of google chrome

rapid sparrow
deep hill
# rapid sparrow

here from time import sleep
import pyautogui as pt
from pynput.mouse import Controller, Button

mouse = Controller()

class Clicker:
def init(self, target_png, speed):
self.target_png = target_png
self.speed = speed
pt.FAILSAFE = True

def nav_to_image(self):
    try:
        position = pt.locateOnScreen(self.target_png, confidence=.74)  # region=(0, 84, 1277, 793)
        pt.moveTo(position[0] + 15, position[1] + 15, duration=self.speed)
        pt.leftClick(pt.position())
        pt.PAUSE = 20
    except:
        return 0

if name == 'main':
clicker = Clicker('images/1111.png', speed=.15)

end = 0
while True:

    if clicker.nav_to_image() == 0:
        end += 1

    # End the loop
    if end > 20000000:
        break

i just want to detect image, thats all

tulip stump
#

I want to fix this script error someone help me 🙂

lavish ravine
rancid schoonerBOT
#

Hey @tulip stump!

It looks like you tried to attach file type(s) that we do not allow (.pak). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

heavy knot
#

Hello 👋
I have the following nginx manifest

# nginx.yaml
apiVersion: v1
kind: Service
metadata:
  name: nginx-svc
spec:
  selector:
    app: nginx
  ports:
  - port: 1234
    targetPort: 80

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - image: nginx
        name: nginx-container

and the ingress manifest

# ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hello-ingress
  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
  rules:
    - http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: nginx-svc
                port:
                  number: 1234

When I apply these, the service, deployment & ingress both get successfully configured.
kubectl apply -f nginx.yaml -f ingress.yaml

However, I can't seem to figure out how to reach the nginx service through ingress.
Running kubectl get ingress results in

NAME            CLASS    HOSTS   ADDRESS        PORTS   AGE
hello-ingress   <none>   *       69.69.69.5     80      51m

Now, running curl http://69.69.69.5:80/ results in a Connection refused

#

The question is of course: What am I doing wrong ? :D

rapid sparrow
# heavy knot Hello 👋 I have the following nginx manifest ```yml # nginx.yaml apiVersion: v...

make diagnostics with kubectl get svc
ingress is supposed to be creating loadbalancer servide object there, which was supposed to be giving access to it over 80/443 ports

---
# Source: ingress-nginx/templates/controller-service.yaml
apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: 'true'
  labels:
    helm.sh/chart: ingress-nginx-4.0.10
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/instance: ingress-nginx
    app.kubernetes.io/version: 1.1.0
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: controller
  name: ingress-nginx-controller
  namespace: ingress-nginx
spec:
  type: LoadBalancer
  externalTrafficPolicy: Local
  ipFamilyPolicy: SingleStack
  ipFamilies:
    - IPv4
  ports:
    - name: http
      port: 80
      protocol: TCP
      targetPort: http
      appProtocol: http
    - name: https
      port: 443
      protocol: TCP
      targetPort: https
      appProtocol: https
  selector:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/instance: ingress-nginx
    app.kubernetes.io/component: controller

if copying from code of ingress-nginx deployment

#

if you run self hosted solutions like microk8s/k3s, they don't have working load balancers until you added support to them to cluster

#

MetalLB is a possible solution

#

for cloud managed Kubernetes Cluster like Digital Ocean K8s cluster, this is solved at the level of provider, and they initianizlize automatically cloud level load balancer
Of course may be u have a different problem

heavy knot
#

One minute

#

Which diagnostics are you looking to extract with kubectl get svc

rapid sparrow
heavy knot
#

Did you mean describe ?

#

There aren't

rapid sparrow
#

they supposed to be having assigned ip address

heavy knot
#

It's all ClusterIp

rapid sparrow
#

well. that is a problem

heavy knot
#

I'm running my cluster with minikube

rapid sparrow
#

your ingress did not create loadbalancer object at all

#

therefore nothing is present to grant external access to it

#

external access is provided only with next methods

  1. Node Ports services for 30000 ports+
  2. Load balancers services
  3. you can personally get access to services by using port forwarding for yourself
heavy knot
#

So the tutorial I'm following is wrong

#

This one makes NodePort service

#

& I still am running into the same issue

#

Let me have a go at it again

rapid sparrow
#

Note: If you are running Minikube locally, you can visit hello-world.info from your browser.

#

although during local running, supposed to be accessed too. Or may be previous step is obligatory

heavy knot
#

I did see that & followed it

#

Still nothing

#

I'm rerunning it again

#
curl: (28) Failed to connect to hello-world.info port 80 after 21056 ms: Timed out
willow pagoda
#

How would I set up a package so that during creation of its wheels, it uses npm to build a subproject and then distributes the artifacts in place of that source code?
For context, the project consists of two python packages, one of which contains the node.js project and an entry point to start up a website using the generated files. I'm looking into switching from hatch to setuptools for this customized build process, but I can't find any structure I should follow for this. Is there a better way than just using subprocess.check_call() at the start of setup.py?

worthy ivy
#

Can anyone point me in the right direction for how to create a connection string for Azure DevOps?

I've tried using azure.devops module, but all documentation points to using azure.devops.connect (or azure.devops.connection) and when I try either of those I get an error:

AttributeError: module 'azure.devops' has no attribute 'connect'

willow pagoda
willow pagoda
worthy ivy
#

import azure.devops

print(dir(azure.devops))
['builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'path', 'spec', 'pkg_resources']

willow pagoda
#

seems to work fine for me

thorny shell
#

azure.devops is a module; it won't have a connection or Connection attribute

#

which is pretty annoying, now that I think about it

willow pagoda
rancid schoonerBOT
#

azure-devops/azure/devops/__init__.py lines 1 to 6

# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)```
worthy ivy
#

I may also be confused in that I'm very new to python. 🙂

#

My goal is to retrieve a file from an azure dev ops repo.

I at least now have got past the:
client = Connection(adoconnectionstring)

Next is to retrieve the file, but not sure if it's possible with something like this (co-pilot suggested this):

filecontent = client.git.get_item(adoprojectname, adorepositoryname, adorepositorypath + adorepositoryfilename)
#

Again:
AttributeError: 'Connection' object has no attribute 'git'

#

client.get_item also doesn't work

rapid sparrow
worthy ivy
#

Yeah, intellisense is working, but I'm not seeing anything about get items or files, etc.

#

I'm using VSCode. 🙂

#

Is there a way to get a summary/one-liner of what an attribute of a module is suppose to be used for?

Hardest part for me right now is knowing where to look for help/explanations.

willow pagoda
#

https://docs.python.org/3/tutorial/classes.html#python-scopes-and-namespaces

... for example, in the expression z.real, real is an attribute of the object z. Strictly speaking, references to names in modules are attribute references: in the expression modname.funcname, modname is a module object and funcname is an attribute of it.
most dot-notation syntax you see is for accessing an attribute of some object

thorny shell
willow pagoda
#

ah you meant just getting info on some specific attribute

#

documentation site would also be helpful too, but absent that you can try to look through the source code to figure out what you need

worthy ivy
#

All super helpful, thank you!

willow pagoda
# willow pagoda documentation site would also be helpful too, but absent that you can try to loo...

for example, the github example shows getting a "CoreClient" from the connection before accessing its related API ```py
connection = Connection(base_url=organization_url, creds=credentials)

Get a client (the "core" client provides access to projects, teams, etc)

core_client = connection.clients.get_core_client()

Get the first page of projects

get_projects_response = core_client.get_projects()``` if you start at azure/devops/connection.py you'll find where the Connection object is declared, and in it you see that the .clients attribute is set to a ClientFactory instance:
https://github.com/microsoft/azure-devops-python-api/blob/6.0.0b4/azure-devops/azure/devops/connection.py#L35

rancid schoonerBOT
#

azure-devops/azure/devops/connection.py line 35

self.clients = ClientFactory(self)```
willow pagoda
rancid schoonerBOT
#

azure-devops/azure/devops/released/client_factory.py lines 46 to 51

def get_git_client(self):
    """get_git_client.
    Gets the 5.1 version of the GitClient
    :rtype: :class:`​<GitClient> <azure.devops.released.git.git_client.GitClient>`​
    """
    return self._connection.get_client('azure.devops.released.git.git_client.GitClient')```
willow pagoda
#

this time github can't resolve it, but if you go one directory outside you'll find a git/ folder containing the GitClient, and in the GitClientBase class it inherits from you'll find a bunch of methods that you can call on it
https://github.com/microsoft/azure-devops-python-api/blob/6.0.0b4/azure-devops/azure/devops/released/git/git_client_base.py
thankfully the devs added docstrings for them so you can figure out what each parameter should take, and the paths they use like azure.devops.v5_1.git.models.GitVersionDescriptor can point you towards the file you should be looking at (azure/devops/v5_1/git/models.py)

worthy ivy
#

Wow, thanks!

I do see get_item in git_client_base.py

#

line 462

willow pagoda
#

i gotta say it sucks that there isnt a documentation page and barely any intellisense compatibility (i.e. type-hinted code)

worthy ivy
#

You are helping me get started in the right direction though, so I appreciate it.

#

I'll have to circle back on this in a couple hours, need to get home/dinner/etc.

night elk
#

I can’t connect to a docker container running inside WSL2. The container is served via a compose file, port forwarding is 8000:8000, but I can’t access localhost:8000 on the windows host saying the server sent an empty response (it runs fine with a proper Ubuntu vm) anyone developing using WSL2 had this problem?

lusty forge
#

This could be an IPV4/6 issue where it defaults to IPV6 in some cases

urban needle
#

can I make the actual app a kubernetes loadbalancer? (or it must be another service that routes to my app)

rapid sparrow
#

MetalLB project implements kubernetes load balancer for self hosted clusters
It is used by user as service

urban needle
#

Okay, thanks!

rapid sparrow
#

Are you allowing access to tool immediately after registration?

clear bronze
#

you will receive it on March 21

rapid sparrow
#

!rule 6 delete then

rancid schoonerBOT
#

6. Do not post unapproved advertising.

rapid sparrow
#

Kind of scam to gather emails and other personal data at this point

clear bronze
#

no, the first version will be released on March 21 for those who sign up for the waitlist

#

and is free

rapid sparrow
#

<@&831776746206265384>

clear bronze
#

why?

#

We are a Startup, we do not scam

rapid sparrow
#

Because u don't really provide it for free
U just advertise with gathering personal data at this point, which has a cost too. Therefore it is not free, it is payment with personal data for nothing at this point of time

hot snow
#

!rule 6

rancid schoonerBOT
#

6. Do not post unapproved advertising.

clear bronze
#

but absolutely not, it’s free, if you want to try it before everyone on March 21 we will deliver it to you, it will be free until we reach 1M of users, we are taking investment in our startup

toxic bough
#

Darkwind is right

hot snow
#

Please don't use our server as an ad board

clear bronze
#

on discord there is too much mischief, when you all use our AI to create websites and apps we talk about

analog kettle
#

@clear bronze we can appreciate that you're not being malicious, but you're ultimately still promoting a business venture of yours, and that isn't something that's allowed here.

#

If you have any questions about our policies, you can ask us over @balmy mulch

clear bronze
#

okay you’re right, I thought it might help some freelancer or student who creates websites regularly

lusty forge
#

I've got a game-themed Discord bot (running in a Docker compose) that'll have a command to display the global player history of the game. This can be retrieved through Steam's web API, so I'd just query it every n minutes and add the record to a db for that specific time to graph on-request.

Running this as a microservice is likely the best choice, since it wouldn't be dependant on the bot (and its services) being online. I could have this run directly on the hardware with Postgres and a crontab executing the script every n minutes, just exposing this to the bot's compose would be trivial. Is this the best way of running the microservice?

rapid sparrow
# lusty forge I've got a game-themed Discord bot (running in a Docker compose) that'll have a ...

Hey there. Very similar project i already refactored three times from zero until i achieved level of comfort for development / maintability / and code simiplicity to do it well

What i learned from my experience

  1. in attempt number one i quickly coded discord bot functionality fully, it was working... but full of bugs, hard to test because everything depended on Discord.py, including making loop task to query stuff in background. its architecture is not testable and awful, Discord.py was breaking all the time

  2. in second attempt i went with proposal similar to yours https://github.com/darklab8/darklab_darkbot/tree/master/OLD_CODE2/architecture i went with many microservices, separating service parts into 4 microservices, one was important for scrapping and providing data as rest API, another one to configure user settings, another one served as simplified rest api to make requests to discord and etc. Not even was able to finish. Too many microservices led to very unpleasant development and hard to finish it. Tried using Postgresql for user settings as well
    I tried to mitigate damage from Discord.py and used to redirect its input fully to Argparse, but it did not still work well enough considering amount of microservices
    (Later i was recommended https://github.com/hikari-py/hikari btw, as more lightweight better discord alternative)

#

===
3) And the third attempt was the most succesful one. https://github.com/darklab8/darklab_darkbot
https://discoverygc.com/forums/showthread.php?tid=188040&pid=2282025#pid2282025
I just made it in golang, with having necessary loops in background as a gouroutine (which is multithreading)
And yeah i continuied redirect input to CLI library (this time golang Cobra), and giving output back to user.
Everything works smoothly, simple, as singly binary with 4 of my background multithreaded loops running at the same time.
And with almost zero dependene on any third party discord libs

So... from my experience, i recommend making it as single application. Don't make microservices when you are single dev, you are only overcomplicating stuff and making harder to finish it

Use Celery for background loop tasks in python as most reliable solution of python world, but potentially recommending exploring using just multhreading loop task in background. In golang it works well 🙂 (for python i am unsure how well this idea is) This helped me avoiding need for databases, as i just keep necessary data in memory objects, and other threads can access it in mutex lock fashion to avoid data corruption

#

In third attempt i went to store user settings just in Sqlite3, it was absolutely enough

#

end result, is single binary launchanble file, that just keeps its state in single sqlite3. Easy to build, launch, maintain. I was fully satisfied with end result

#

=====
even if you would split smth to microservices... good idea to have typed input/output of them, with code reusage shared between services. Makes stuff easier., which are tied to Pydantic BaseModel. Mypy/Pyright stuff is necessary for easy development and matainance. In golang and other typed languages this problem is not standing though.
FastAPI and Django Ninja are kind of welcome stuff in this regard

#

In general i am quite recommending Celery approach to python solution (Celery beat i mean as alternative to cron jobs), because with testing fixtures available, it is easy to test their code, and they out of the box mitigate damage of python problems having runtime unhandled errors crashing app. So yeah, Celery should be better choice in Python world in comparison to just using multhithreading looped tasks in Golang, where it is enough pithink

rapid sparrow
# lusty forge I've got a game-themed Discord bot (running in a Docker compose) that'll have a ...

TLDR: Recommending https://github.com/hikari-py/hikari

  • Celery beat https://docs.celeryq.dev/en/stable/userguide/periodic-tasks.html
    if u will need smth from rest apis, then FastAPI/Django Ninja
    Mypy/Pyright + Pydantic BaseModels to use more often across applications
    Avoiding usage of postgres for simple bots, and just using sqlite3
    Not making microservices, make a single monolith, launched in different processes (Main one with Discord + Celery beat(puts loop task requests into queue) + Celery worker(executes loop tasks requests))
#

Celery beat worker is persistent to crashing and will be a good cron job solution, it has its own separate process. It will run your loop requests splendidly

#

Ergh, due to having different processes not sharing memory, you will be probably needing to glue it with Redis for shared easy memory stuff if necessary. In golang i did not need it, since multhreading background loops (instead of Celery) kept stuff in shared memory. Golang is more resistent to error crashing.

lusty forge
#

Woah, quite the journey. The approach of having everything as one binary/app won't work for me, since I'd like a degree of resilience. If the bot ever dies, having the microservice(s) running would be ideal. Considering they're relatively small, I don't mind this.

Currently I'll just have the db running in a compose, the bot with pm2 and the microservices as standalone scripts executed by cron which'll fetch the data and add it to the db. With how lightweight they are, calling these microservices is one hell of a stretch lol

rapid sparrow
# lusty forge Woah, quite the journey. The approach of having everything as one binary/app won...

up to you, up to you 🙂 Golang made me app heavy resilient just because error handling in golang happens in code almost always (instead of encountering unexpected runtime errors). I offered Celery to complensate this problem in Python, since it will make loop tasks in its own processes, fault tollerant and protected from others. Celery offers quite a bunch of fault tolerant features. Celery code will allow to make it a single shared monolith, just launched in multiple processes.
Celery will allow easily having your cron jobs in python code instead of in cron, kind of better from the point of code maintainability and control

obtuse cape
#

Hi, I have started my npm and code is running successfully

#

but i'm not able to access the endpoint

#

I'm using AWS

worthy ivy
# willow pagoda this time github can't resolve it, but if you go one directory outside you'll fi...

Not sure if you are around or if someone else reading this can help. I'm new, very likely to misuse terminology, but trying to learn!

Trying to create a connection string for Azure DevOps and then read a file from an Azure DevOps repo, but having trouble accessing the functions (methods?).

I'm using azure.devops:
https://github.com/microsoft/azure-devops-python-api/tree/6.0.0b4/azure-devops/azure/devops

from azure.devops.connection import Connection

I see the functions client_factory class: https://github.com/microsoft/azure-devops-python-api/blob/6.0.0b4/azure-devops/azure/devops/released/client_factory.py#L46-L51

And the functions from get_client_base
https://github.com/microsoft/azure-devops-python-api/blob/6.0.0b4/azure-devops/azure/devops/released/git/git_client_base.py

But don't know how to access those functions.

Specifically I believe I need the get_items() function from git_client_base.py from line 462 in that file.

Not sure how to access that after importing azure.devops though.

If I do:
from azure.devops.connection import Connection

client = Connection(adoconnectionstring) #contains the https/url

filecontent = client.get_item(<with ADO project name, repo name, etc>)

Error: AttributeError: 'Connection' object has no attribute 'get_item'

rancid schoonerBOT
#

azure-devops/azure/devops/released/client_factory.py lines 46 to 51

def get_git_client(self):
    """get_git_client.
    Gets the 5.1 version of the GitClient
    :rtype: :class:`​<GitClient> <azure.devops.released.git.git_client.GitClient>`​
    """
    return self._connection.get_client('azure.devops.released.git.git_client.GitClient')```
worthy ivy
#

Part of my confusion is understand the relationship between the files, classes, objects, etc within a python module.

Example: I can use from azure.devops.connection import Connection
I see the Connection class (object) from the connection.py file from inside the azure.devops module.

I also see GetClientBase class (object) from the git_client_base.py file from within the azure.devops module.

However, when trying:
from azure.devops.gitclientbase import GitClientBase

I get an error:
ModuleNotFoundError: No module named 'azure.devops.getclientbase'

pine echo
#

Long story short, we cannot use mkdocs and the github pages feature for our documentation since our current infrastructure has a big issue when we use multiple branches. All our repos are quite small with 5-8 files and max 20 functions in total.

Is there any way to fetch all the DocStrings from every file and create an one page documentation for README.md or I manually post to a Confluence page?

vague silo
#

@pine echo I believe sphinx has a singlehtml builder that could work for Markdown. There’s also a confluence builder on pip

pine echo
#

I haven’t worked with sphinx before. But will check it asap. Thanks a lot

rapid sparrow
#

There should be docstring doc building in mkdocs too somewhere in theory

#

At least DRF documentation was made with mkdocs and suspiciously looks like it has autodoc used too

rapid sparrow
red oxide
#
services:
  api:
    platform: linux/x86_64
    build: .
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun
    container_name: dc-isp-manager-api
    restart: always
    ..
    ..
    command: 
      - /app/installer

How can I execute the command /app/installer such that the container doesn't close when the command fails?

heavy knot
#

Anyone using pre-commits for fastapi project?

vague silo
vague silo
red oxide
# vague silo Wrap it in a shell command, like ```yml command: - /bin/sh - -c - '/app/installe...

I've tried this, I'm sorry but my question is incomplete. Let me clarify what I'm doing exactly.

Basically I have a fastapi based webservice. Some routes are for executing some executable and getting their output, but inorder to make these executables work, I need to run an installer executable first so that it would install all the dependencies.

I need to mount some devices as well as u can see in my compose file. Installer won't work without them.

So I need some way to run installer once everything is mounted but before the web services run.

Currently as a work around, I'm first starting the container and then executing the installer by docker exec into the container.

Let me know if there could be possible to have a better solution

arctic canyon
#

you can use the "os" module to run system commands, so "os.system()" to run "mount"

#

you can make sure the installer runs before the web by using an "entrypoint" option in your Docker Compose file?

#

And then you can use a "time.sleep()" call to wait until the device is mounted before running the installer?
so "os.path.exists()" to check if it exists?

red oxide
#

Using entry point seemed like a solution to run the installer before running the web app. But for some reason, it would close the container after installer runs instead of running the web app.

I'm already using subprocess to run those mini exe scripts on api calls, but need to run installer before the web app runs so the mini exe can execute properly when api endpoints are called

rapid sparrow
#

it enforces them by pre-commit hook

#

based on properly written commits enforced by this tool, it allows to generate changelogs of features/fixes for product release

#

and also automatically sugests next semantic version release of a product ( https://semver.org/ )

#

this tool is hopefully quality remake in golang of an old buggy npm tool with awful code and lot of dependencies that break the tool: https://www.npmjs.com/package/git-conventional-commits . I just kind of remade it cleaner in golang with minimal dependencies, CI friendly one binary file to use without any dependencies including git.
And just augmented with some stuff that was missing or broken
I liked that npm tool, but it was just hehe broken in some features, and author just redirected for repairements to his all dependencies authors

heavy knot
rapid sparrow
#

as for fully automatically automatically without even single commands, you would need to have some tool installed / scripts configured that would react to git clone command
it would have been simpler to just use taskfile though, it is not like it is hard to run some kind of task hook:setup command

#

though you know... in order to ensure that project has its tests/lints running, people just use CI tools like Github Actions / Gitlab Ci, it ensures running lints/tests and etc stuff on every commit server side

worthy ivy
#

I cannot for the life of me figure out how to make a successful connection to Azure DevOps using Python.

#imports go here
import pandas as pd
import os
import azure.kusto.data
from azure.kusto.data import KustoClient, KustoConnectionStringBuilder
from azure.kusto.data.helpers import dataframe_from_result_table
from azure.identity import ManagedIdentityCredential
from azure.identity import DefaultAzureCredential
from azure.kusto.data.exceptions import KustoServiceError
from automationassets import get_automation_variable
from http.client import HTTPConnection
import http.client
import socket
from azure.devops.connection import Connection

Get the managed identity token

credential = DefaultAzureCredential()

Set the Azure DevOps organization URL

org_url = get_automation_variable('ORG_URL')

Create a connection to Azure DevOps using the managed identity

connection = Connection(base_url=org_url, creds=credential)

Get the organization name, project name, and repository name

org_name = connection.get_client("core").get_current_connection_data().location.lower()
get_automation_variable('PROJECT')
get_automation_variable('REPO')

Get the organization name, project name, and repository name

org_name = connection.get_client(get_automation_variable('ORG_NAME')).get_current_connection_data()
project_name = get_automation_variable('PROJECT')
repo_name = get_automation_variable('REPO')

Print the results

print(f"Organization name: {org_name}")
print(f"Project name: {project_name}")
print(f"Repository name: {repo_name}")

#

Error:
Failed
Traceback (most recent call last): File "C:\Temp\jbq50cn4.bwh\737851cb-2b18-433f-ac16-690a5541ed1b", line 75, in <module> org_name = connection.get_client(get_automation_variable('ORG_NAME')).get_current_connection_data().location.lower() File "C:\WPy64-3800\python-3.8.0.amd64\lib\site-packages\azure\devops\connection.py", line 44, in get_client client_class = self._get_class(client_type) File "C:\WPy64-3800\python-3.8.0.amd64\lib\site-packages\azure\devops\connection.py", line 52, in _get_class imported = import(module_name)ValueError: Empty module name

Doesn't seem to matter what I use in get_client("<here>"), always ends in the same error.

heavy knot
#

Can anyone show me how can I write a python script setup.py that will install dependencies from requirements.txt and setup git hooks for my repo? I am new to python and am struggling a bit to understand this.

thorny shell
#

dunno why you'd need a script for that

#

to install dependencies from requirements.txt, you type python3 -m pip install -r requirements.txt

#

to set up the git hooks, I think you just add them to your git repo, and commit them, like any other files

#

also, if you do choose to write a script to do this stuff, don't name it "setup.py"; that name is effectively reserved for a special purpose

heavy knot
#

Wanted to do this by running one single file

#

And the development environment will only be windows.

#

No linux or mac

#

Maybe I can write a setup-hooks.bat or setup-hooks.ps1

willow pagoda
#

i dont think it would make sense for a setup.py to install git hooks given that it only runs when your package gets built from source, which doesn't imply the presence of version control

#

but i guess having it define dependencies from a requirements.txt is fine, you simply need to parse the file into a list and use the install_requires= parameter to tell setuptools about the dependencies

#

e.g. ```py
from setuptools import setup

with open("requirements.txt") as f:
requirements = f.read().splitlines()

setup(
...,
install_requires=requirements
)```

blazing ravine
#

any xonsh user here?

true grove
rapid sparrow
#

hooks are applied only to repository git operations anyway

#

unless persons uses git operations to this repository he would not see it

#

and considering that person needs concocious effort to clone with hooks installed after that... i guess he is already reviewed code to approve those hooks

#

there is very small difference from regular program installation process. (or pretty much no difference)

rapid sparrow
#
from setuptools import setup
from codecs import open
from pathlib import Path
import os

here = Path(__file__).parent.absolute()

print(os.listdir(here))

with open(str(here / "README.md"), encoding="utf-8") as f:
    long_description = f.read()

with open(str(here / "requirements.txt"), encoding="utf-8") as f:
    requirements = [line.strip() for line in f if not line.startswith("#")]

setup(
    name="package",
    version="0.0.1",
    install_requires=requirements,
    long_description=long_description,
    url="https://github.com/package/package",
    author="author",
    license="UNLICENSED",
    keywords=["django", "django rest framework", "celery"],
    python_requires=">=3.8",
    packages=["package"],
    include_package_data=True,
)

trying to build package, but during building, it excludes all files, but i need requirements.txt 😆 how to add requirements.txt temporally for setup.py script during build?

* Getting build dependencies for wheel...
['setup.py', 'README.md', 'package.egg-info', 'PKG-INFO', 'setup.cfg', 'pyproject.toml', 'package']

i get error

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/build-via-sdist-3fmq3qog/package-0.0.1/requirements.txt
#

oh wait, with python3 -m build --sdist --wheel it built for some reason sucesfully

#

magic 🙂

willow pagoda
#

iirc it was specifically py -m build -w which caused build/ artifacts to linger, while py -m build automatically removed it (i assume they're not meant to stay there?)

gentle solstice
#

I'm doing some tinkering with dokku, and will eventually try to integrate it with my current kubernetes cluster. I got dokku to run and deploy an app on a rhel 7 vm with docker, but unfortunately I'm having troubles configuring it with minikube running on the same host.

Any ideas how I can let my dokku container know about the minikube container?

#

After adding kubectl, kubeconfig and minikube certs manually to the container, I just get this error.

dokku@d6bb5291d1b9:/tmp$ kubectl get pods
E0316 18:40:21.428437   99124 memcache.go:238] couldn't get current server API group list: Get "https://192.168.49.2:8443/api?timeout=32s": dial tcp 192.168.49.2:8443: i/o timeout
#

should I switch to k3s instead of minikube so I can access it from the network? Maybe I can configure dokku to run inside minikube

gentle solstice
#

Screw it, I'll use my live instance of k8s

#

I've got one with barely any pods on it

wet bison
#

Hey guys. Need some piece of advice from devops guys. Currently choosing between GitHub and gitlab to host our project and I’m honestly struggling to find the big difference between platforms.

I’ve read on the internet that gitlab provides "GitLab has Continuous Integration/Continuous Delivery (CI/CD) and DevOps workflows built-in"...but github has that too, no? I've used github actions before in one of my projects... and so far it's been great. So what's the "core difference" between these two? Github has ci\ci with gihub actions.. and gitlab has it too..

Thanks for helping!

rapid sparrow
#

major difference will be only that in Github Actions u can use Actions Marketplace, while in Gitlab CI i think it does not exist, and u would have to use stuff like Ansible to achieve some cases similar capabilities, while for other stuff only using workarounds from ecosystem of public docker images, but that would be still i think less than what offers Github Actions pithink Less proprietary ties will be though

gentle solstice
#

Also you can self-host gitlab if you choose to

thorny shell
#

I doubt there's a "core difference". github is part of Microsoft, and is presumably well funded; I'd expect them to have groovy features before gitlab.

gentle solstice
#

in the past if you wanted a private repository, you would go for gitlab or bitbucket. Though github has private repos and enterprise plans now with custom domains.

thorny shell
#

github smells more "enterprise-y" to me, fwiw

wet bison
#

got it guys. thanks for sharing your experience 👍

tulip stump
gentle solstice
heavy knot
#

when i run my exe why does it say "no module named Crypto"

#

crypto down or some?

loud bear
#

Can I have a single RST file which compiles to 2 separate pages with sphinx?

#

Its kinda boring to manage 3-4 line files

languid blaze
#

Hi folks. Quick question. What actually is observability? Everyone I ask gives me a different answer.

rapid sparrow
# languid blaze Hi folks. Quick question. What actually is observability? Everyone I ask gives m...

your eyes and ears to monitor behaviour of your application, seeing metrics / logging / tracing and etc of your application, that gives full undestanding that application works correctly, and giving you enough information to predict that it will be in a close future still working correctly or warning in advance about some bad events tha twill happen soon (Your server runs out of storage disk free space) 🙂

Observability exists at least of two forms

  1. Technical observability / where we monitor there are no errors/ enough storage / ram and etc to run app / http requests go as they were supposed to go / logging and tracing information about requests to application shows no errors
  2. Business Observability, where we gather intel about user actions, and give it to salesman in order to optimize business strategy
#

Observability for technical side gets often automated, as we set certain precise metrics we wish to see, like database requests are completed in less than N time, requests to app in less than X time and etc
if our monitored situation gets worse, we get automated alerts

#

Observability is necessary to control risk for our application

#

if everything goes smoothly, or at least within certain amount of... level of acceptability, we more rapidly go forward without fear
if we encounter troubles for more time of downtime they we promised to uphold -> we work more on getting more stability / obserability and etc of our application

#

without observability we can't know if we uphold application working to the promised percentage of uptime correctness like 99%

#

because users aren't obligated to tell about happened errors, monitoring system should tell us before users tell us

rapid sparrow
# languid blaze Hi folks. Quick question. What actually is observability? Everyone I ask gives m...

For more information regarding observability, and everything else related to maintenance of an application, recommending just reading google sre books https://sre.google/books/
Goals and practices are told there in a more precise manner

fossil temple
#

why does docker-compose up get stuck at run start?```
74.2s => CANCELED [vibeo-backend 7/7] RUN npm run start
60.2s => CANCELED [vibeo-frontend 7/7] RUN npm run start

Both ``vibeo-backend`` and ``vibeo-frontend`` share a similar dockerfile:```dockerfile
FROM node:19.8.1

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE xxxx # port is different on both

RUN npm run build
RUN npm run start

frontend/package.json scripts:```json
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},

``backend/package.json`` scripts:```json
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "npx tsc",
    "start": "node dist/index.js"
  },
tepid light
#

I’ve begun using a tool called CodeScene to analyze Python code, and it is free for Open Source projects (as mine is). I haven't any experience using it in in-house projects (only Open Source), but really like the perspectives on tech in the analysis and reporting. I haven't really seen that kind of view on tech before in similar tools. If you are a CodeScene user at work, do you have any feedback to share about it? Have a look here: https://codescene.com/

CodeScene help teams pinpoint key software issues, detect delivery risks and measure organizational aspects in order to reduce technical debt.

slim maple
#

You need to use ENTRYPOINT or CMD

mystic void
#

Any concrete example of actionable information for your project?

tepid light
#

I’ve just begun using it, but my expectations are to quickly find out when/if things like tech debt is becoming an issue, but so far all looks “green” and nice.

Besides one thing, probably important to do something about: “knowledge distribution” - makes total sense, since I’m the only maintainer, with few contributions so far.

#

Another thing that I just realized I forgot to add (was planning to do that this weekend) is the Pull Request quality gate of the tool. This is probably extra important in projects like mine, when the one creating a pull request and the one merging/approving it is the same person 😆

heavy knot
#

anyone???
\

civic grove
heavy knot
#

vs code ?

#

my suspicion is now miniforge's distribution of python3.10 is somehow broken

civic grove
heavy knot
#

okay thank you

tepid light
#

Maybe I have misunderstood your question, but would it be possible to activate it just as you would with a virtual environment you have created? More details here on the basics of venvs: https://realpython.com/python-virtual-environments-a-primer/#activate-it

In this tutorial, you'll learn how to use a Python virtual environment to manage your Python projects. You'll also dive deep into the structure of virtual environments built using the venv module, as well as the reasoning behind using virtual environments.

karmic nova
#

Hi, we have released an Open source tool Pair (https://github.com/jiggy-ai/pair), An iterative, stateful chat-like interface for programmers to pair programming with GPT-4, might be useful to some of you. Github Copilot is a great tool for leveraging GPTs while coding, but it is too “open loop” for more complex tasks that require Q&A, feedback to guide it in a particular direction, iteration on code execution errors, etc. There is a large class of tasks that are better accomplished in an iterative, stateful chat-like interface, thus we built Pair. You are welcome to use it and also to contribute to it.

loud bear
#

I am pushing releases to PyPI from my CI, every release I push is successful and the workflow is too. However the GitHub action publish badge always says failing

golden dawn
#

I'm looking to automated some workflows that involve running a bunch of commands locally then copying a bunch of files to some remote host then executing a fairly large workflow on the remote host involing monitoring an application that runs, maybe using something similar to pytest to run a bunch of tests and producing a report then cleaning everything up. This is all on linux. So far I can think of pytest, fabric, dask, luigi, (airflow but its probably overkill). Ansible came up but I think I'd prefer something purely pythonic if possible.

rapid sparrow
golden dawn
#

Does ansible support resuming say if the workflow was killed in the middle of it?

rapid sparrow
golden dawn
#

hmm

#

is there any way to have a python script call into ansible so I don't need to invoke ansible directly?

rapid sparrow
#

U can integrate python scripts.. or any other language scripts

golden dawn
#

I'll have to look into ansible a bit more closely then

rapid sparrow
rapid sparrow
#

Good enough book to learn it from zero to average+ level

golden dawn
#

thank you!

tulip stump
#

https://www.pubgmobile.com/pictures/M21/LV50.png

This type of lots of png link have in this webpage but, i get this links only from some .dat files in game folder,, so i need ur help, how can I get all png file in this webpage, without unknown png links

#

Someone help me

tulip stump
#

Help to web scrap

vague silo
arctic rose
#

Hi, I have joined an internship in a startup and in the interview I told that my goal to learn from this internship is to learn how applications work in production.

so after I got selected we had a meeting discussing the high level architecture of the backend system.

OpenRemote
All Devops, Security & Monitoring components (Signoz, Jenkins, Nagios & Snyk)
RabbitMQ
Docker swarm, Nginx config etc.

I have been assigned to learn the above technologies and I'm only familiar with docker here, also the backend framework is using fast-api and mongo which I am comfortable with. and hosted on GCP never used it but I wanna learn but all of it is behind a paywall.

The first tool is an IOT tool something, the startup is a parking management system so it has to take data from sensors and stuff we can ignore that for now cause this might not be the right channel for it.

but if I had to go about learning the rest of the tech stack, what would be the best way to go about it?

#

I would assume it is to get some cloud platform and actually publish a working project and slowly integrate the different tools I have to learn but I don't have a credit card and ones that accept debit cards just don't seem to work for me. they always get declined or give me some hundred other errors.

vague silo
# arctic rose Hi, I have joined an internship in a startup and in the interview I told that my...

the best way to learn about Nagios and Jenkins is to use them. Nagios is relatively straightforward: it's a monitoring system that works around "checker scripts" : programs that exit with code 0 if all is good, and 1-3 for critical / warning / unknown. In Nagios you configure your servers and services to check (checked with these check_commands that are configured in Nagios) and it will take care to check those regularly. Lots of functionality in Nagios is built around alerting like silencing alerts, scheduled downtime etc.
I would probably ask for read-only access to their Nagios instance to get some first-hand experience with it. The way I started learning it was by writing some checkers my old boss asked me for.

#

Docker Swarm is deprecated as far as I remember so I wouldn't recommend to pour too much time into learning it.

#

As for nginx configuration, I recommend getting some server somewhere (raspberry pi, or a VM on some cloud provider) and just setting up nginx to serve something: for example, make your website serve a copy of the Django docs, or a homepage for yourself. Learn about how to get nginx to forward requests to another service (called "reverse proxy"). Learn how the include system works and how nginx utilizes it in installations on modern distributions (e.g. /etc/nginx/conf.d, ...). Learn how to provision certificates automatically with certbot (use your previous knowledge from serving static HTML files and use the webroot authenticator). And one more fun exercise: set up an nginx instance to act as a caching proxy to pypi.org: that is, you can point your pip clients to it and it will cache packages locally for a while to speed up downloads and reduce load on pypi

#

snyk is some security scanning tool. I don't think there's too much to learn about it, as fixing the vulnerabilities of it is more important

#

I have no idea what OpenRemote and Signoz are. As for RabbitMQ using the setup they have there as a learning point is probably best. Hope that helps

arctic rose
#

Thank you ✨

arctic rose
rapid sparrow
#

I love digital Ocean for comfortable simplicity
But if u need GCP then it is GCP
It is entirely different beast

#

It is not supposed to be usable without infrastructure as a code like Terraform though. Its GUI is heavily overbloated

earnest forum
#

Hello guys, i'm having issues with having network connectivity in docker containers
Have tried adding the dns for systemd-resolved to the "execstart" of the .service file for docker and that didn't work, i also added the --network=host arguments to the command to run the container and that still didn't work. I currently have my firewall to allow outgoing rules. How can i fix this issue

vague silo
#

hetzner is another provider you could check out, they are also cheap and have good servers

#

for netcup I can give you coupon codes, unfortunately for the smallest tier they don't have any. here's a 5€ voucher you can use if you want 36nc16796559900

#

not really, you could mess around with jq to extract data if it's structured omehow

vague silo
#

check your kernel log for any ufw blocks (sudo dmesg -T) that appear when you're running your container (assuming you're running ufw)

earnest forum
vague silo
#

normally docker is kind enough to punch holes in your firewall

#

what's in /etc/docker/config.json?

thorn portal
#

when i run requests like apt-get update or run a dockerfile,
are you having connectivity issue when building a docker image from dockerfile?
or are you having connectivity issue when trying to connect to the outside world from within a running docker container?

just thought that might be an important distinction to clarify.

shut citrus
#

Hello guys i explain to you my github problem
On gitlab i got a project of class
Than i want to push on my personal github for gived the link to people who want to recruit me for a work
But the problem is i got like a empty folder unclickable and i saw is a "submodule"
But me i just want degit
The folder because its now only for desmonstration purpose 😦

thorn portal
shut citrus
#

its a repo of my school session so yes

#

i just want to copy the folder and pushing it on my public git basically

#

but i think someone in mp gived to me a good solution

thorn portal
#

i see.
you probably copied .git over as well, which shouldn't be there if you just want the content of the repo to be demo to be in this new public repo.
the presence of .git probably made git think that's a submodule

shut citrus
#

yes

#

for that i got problem

#

a guy said to me to do git clone --bare

#

and after git push -- mirror new link

#

and that just worked

#

git is painfull

thorn portal
#

cool, that's a little bit more advanced yeah

shut citrus
#

i prefer control c control v

timid schooner
#

@modern robin Hey man, I hope you remembered me, I need some help with aws, could you help me out?

timid schooner
modern robin
timid schooner
modern robin
#

That’s what you’ve used when running instances

timid schooner
pine echo
#

I have multiple repos in Github where at the moment, I create one separated mkdoc github page with their docstrings individually. Is there any way I can create one single github page which will generate and combine the mkdocs for all of the defined repos instead?

modern robin
willow pagoda
steep cedar
#

Hey People,

Just got an Azure DevOps account, and I have a codebase (PyQt6-based Desktop Application) that I will be pushing soon.

I will have 4 branches. main, release, develop, and Hotfix/Update. 2 of us will be working on that.
At the start, I will push my current base to the main, and create a branch Develop out of it.
Once, we are at a good stage to deploy, we create a release branch and create a pipeline trigger based on tag name and branch name release in Azure DevOps.

We tag and push the code to the release branch, and it will generate the build. Once that is done.
We then merge the release branch with Main and remove it from local+remote, and check out to develop.

Can someone check if this strategy is correct, if not, what changes i should make?

timid schooner
# modern robin 30-24.829

yeah but I'm confused as to how that works, cause all the volumes are deleted now so why 30-24... ? and not 30gb as a whole

modern robin
timid schooner
heavy knot
#

I can't speak

#

My mic is closed

modern robin
timid schooner
timid schooner
modern robin
# timid schooner but if I create a new ec2 instance now and I think by default a 8gb ebs is attac...

When you create a new EC2 instance in AWS, by default an Elastic Block Store (EBS) volume is attached to it for the root device. The cost of the EBS volume is based on the storage capacity and the I/O operations used.

If you create an 8GB EBS volume, you will be charged for the storage capacity of the volume as well as any additional charges for data transfer, snapshots, and other EBS features that you use. The pricing for EBS varies by region and depends on the type of volume you use.

To get the most up-to-date pricing information for EBS, you can check the AWS website. You can also estimate your EBS costs using the AWS Simple Monthly Calculator or the AWS Cost Explorer.

timid schooner
#

My active volume is 0 gb
where as my deleted volume is ~24 gb

modern robin
timid schooner
tepid light
timid schooner
# modern robin Delete was once active.

bro I'm confused af regarding this, so by that logic I can only create 3 ec2 instances per month? Cause by default 8gb * 4 = 32 gb which will be beyond free tier

modern robin
modern robin
timid schooner
modern robin
#

It doesn’t charge 8GB just because the instance is created. That’s just the capacity

timid schooner
modern robin
timid schooner
modern robin
timid schooner
modern robin
timid schooner
modern robin
#

I’ve created more an still didn’t hit the limit. So I don’t know 🤷🏽‍♂️

timid schooner
modern robin
#

Dunno bro

timid schooner
shy marten
#

I wanted to make a small PR to fix something, so I created a branch off master, made my change, and committed it, then realized master was out of date, so I did a merge from origin/master, and now my PR contains my change plus the merge. Is that okay, or is it messy? Should I delete the branch and start over from an up to date master?

rapid sparrow
#

if u are worried about having too many commits = just squash them

#

git rebase -i master

#

change pick for all of them except most top one to squash

#

and save/save

#

it will join all your possible commits into one

#

way less noise if desired, without branch recreations

shy marten
#

I did the rebase, changed everything except the latest one (my change) to squash, and it added two more commits. Seems like I did something wrong, should I have squashed all but the oldest instead (including my own commit)?

shy marten
#

Ended up deleting it and publishing again. Feels bad that it didn't work out, but feels good that it's clean.

rancid schoonerBOT
#

Hey @velvet hedge!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

dim token
#

Hey, not sure this is the appropriate channel but i'll give it a go.

I have a code, lets say A1B2C3. I wanna email this to someone, and then have them enter it to a form to verify their email. Is there any tool out there to send this verification code in an email for me? Instead of me having to send it

thorny shell
#

the only ones I know of are insanely complicated 😦

#

Sending email used to be easy, 20 years ago; now it's a pain in the butt

dim token
#

overall? or using some sorta library

thorny shell
#

overall

dim token
#

thats tough

thorny shell
#

library isn't enough; you need a server to send it from

dim token
#

i thought it'd be fairly easy

thorny shell
#

I don't think it is. I could be wrong but I'd bet on it

dim token
#

i'd imagined there was some sort of api or library that would send the email for you

thorny shell
#

it's possible you can do it easily if you don't mind your mail getting flagged as spam

dim token
#

that'd be okay yeah

#

i could tell the user to check their spam

thorny shell
dim token
#

would i need a server

thorny shell
#

dunno

dim token
#

when we say server, we're talking about a whole server to send the email, or just a personal email like xxx@gmail.com for the email to b sent from?

thorny shell
rapid sparrow
thorny shell
#

"server" means "computer", not "string of letters and digits with an @ sign"

dim token
dim token
uneven vale
#

It's showing what lines were added, and what lines were removed

#

yes

#

you can also get this in commandline by running git diff

heavy knot
#

He meant to say in a terminal
bash in linux
command prompt in windows

junior void
#

under WSL, why not?)

eager rose
#

there's also git bash, cygwin

pliant drift
#

Good afternoon everyone, what better video content or article talking about linter for Python which do you recommend? I use it every day, but I never got around to putting one in my hand. It had already automated at work.

mystic void
#

Let's say you are responsible for the release and distribution channels and there was a need for many cloud related skills since most of it would happen in a cloud.
What titles would you use to describe such person?

brazen forge
#

Cloud Release Engineer pithink

mystic void
#

Great! That's what I had in mind too, but wanted to make sure there wasn't something more popular

#

thanks!

gusty flame
#

Hello everyone,
I have created a little python program with which you can create a beautiful readable chapters txt file (of the format "h:mm:ss YOUR_CHAPTER_TITLE") . 
Then you can use the txt file to add your chapter titles and afterwards use the script to attach it to the video. 
Keep in mind though that this program only works in Unix systems like macOS and you need FFmpeg installed on your machine. 
The github repo of the project is here: https://github.com/amireza007/ChapterForVideos
There are some TODO things, available in the code such as a UI and exception handling.
I would really appreciate if you take time to test and even more if you have any comments regarding it or improvements or edits to the project. 
Thanks for your attention

lament cedar
#

is there a package-lock.json equivalent in python?

brazen forge
#

depends on what package manager you use

#

pip-tools can create a lock file in the form of requirements.txt
poetry creates a poetry.lock
pdm creates a pdm.lock
pipenv creates a Pipfile.lock

rapid sparrow
# lament cedar is there a package-lock.json equivalent in python?

node_modules is created manually if using regular pip by running python3 -m venv venv and source venv/bin/activate
default one package-lock.json created by pip freeze > constraints.txt
npm i is pip install -r requirements.txt -c constraints.txt
requirements.txt should be having your top level dependencies, constraints locks only to which version to install them and secondary deps

everything is automated and most comfortable in poetry (choice number 1 today)
it automatically creates node_modules as .venv
when you run poetry shell or poetry install (npm i)
and locks to poetry.lock your package-lock.json (which is fully managed automatically when you just install deps as poetry add package_name)

woven saffron
#

i don't know if docker questions should go here but how could i create a docker image that is just python run python ... and pg_ctl start (for postgresql)

willow pagoda
# woven saffron i don't know if docker questions should go here but how could i create a docker ...

given my tiny bit of familiarity with docker, you probably dont want to create an image running two services and instead use docker-compose.yml to declare multiple containers to run for your application
https://docs.docker.com/compose/features-uses/
that way you can just use the postgres image without any modifications, configure that image correctly,then pass the credentials to your python image using env/secrets
https://github.com/docker-library/docs/blob/master/postgres/README.md

woven saffron
#

oh, so i don't need to set up an image at all

willow pagoda
#

i have a personal repo i can show as an example, although i never actually finished it after i figured out how to connect the services 😔

woven saffron
#

sure

rapid sparrow
rapid sparrow
#

docker-compose examples for FastAPi, Django and Flask made
We just override launching command: for particular containers

willow pagoda
#

docker-compose.yml
https://github.com/thegamecracks/python-todo-list/blob/main/docker-compose.yml

  • credentials are defined in a separate .env file (i think i chose this over secrets for convenience)

Dockerfile
https://github.com/thegamecracks/python-todo-list/blob/main/Dockerfile

  • dependencies are installed and cached in the main-deps layer, and there are three more layers for dev-deps, tests, and prod

app.py
https://github.com/thegamecracks/python-todo-list/blob/main/src/todo_list/app.py

  • sqlalchemy connection is defined here
rapid sparrow
ashen burrow
#

Hey guys, I initially posted this in the general channel and later realized there are more dedicated channels for this kind of topics. So I'm moving it here.

I have a side project I have been working on for ~2+ years. It is a Python library for PDF form processing. In a nutshell it allows filling a PDF form with annotated fields (text fields, checkboxes, etc) by simply feeding a dictionary, along with some miscellaneous functionalities. I built this for the purpose of an easier way of generating PDFs without having to write long and unmaintainable reportlab code.

Right now I have had some users using it and got some feedback from them. However I could really appreciate more users/developers looking into it so that there are more inputs on potentially unveiled bugs, inspirations on new features, ways to improve/optimize the code, or just in general more exposures to this library. If your workflow, whether personal or full-time work project, involves PDF generation, I will appreciate a lot if you could spend some time and take look at this library.

Thank you very much for your time.
https://github.com/chinapandaman/PyPDFForm

GitHub

The Python library for PDF forms. Contribute to chinapandaman/PyPDFForm development by creating an account on GitHub.

thorn portal
willow pagoda
heavy knot
#

How to make something like this?

#

Pls I want to know how to make colour gradient like tht

#

I know how to make the ASCII art

gray valley
#

Guys if i am on a good level of knowing bash script and automation, i make a couple of projects, can i have a part time job using this skill, and where i can find it

Currently i am a chip designer, but I need to make side hustle from bash

rapid sparrow
heavy knot
#

"import pystyle"

#

"from pystyle import *"

rapid sparrow
heavy knot
#

It was an alternate account, with a different name due to being targeted in mass report attacks

rapid sparrow
heavy knot
#

Is this better?

rapid sparrow
#

Much better ☺️ 😎 thanks 👍

heavy knot
#

Welcome.

gray valley
rapid sparrow
# gray valley Nice explanation, its seems very long way even for just a part time job😅

I find its relevancy very low at least.
If u aim for getting hired as infrastructure guy

Learn stuff like
AWS, docker, Terraform, GitHub actions,
Deploying containerised applications and managing managed AWS RDS dateless.
Feel free to add Ansible to this.
Best to know networking at level capable to operate AWA VPC stuff.
Small project with learning how to deploy applications and setting up monitoring and logging will be a good start

#

Bash is used somewhere in between from time to time there

rapid sparrow
#

In each case bash is small augmentary stuff sometimes needed, but main dishes are different (Rest API+Databases) / (or AWS, infrastructure code stuff)

#

Instead of AWS, GCP, Azure stuff can work as well, some people deploy to bare metal.
AWA is just most used and in demand

#

There are system administrator... They know Linux(or Windows servers) how to operate and manage self hosted databases
Bash comes to them as augmentary tool again, but not most important one.
Knowing Linux ecosystem, repairing and maintains dB and apps comes first

#

If they go for Windows Servers, bash is kind of not that applicable though. I heard in newest Windows versions u can run bash in Windows though

#

System administrators are pre-historic role that was before infrastructure as a code and cloud came to play though

vague silo
#

that doesn‘t mean they‘re irrelevant

stray atlas
#

Hi, I was trying to create a script to read my outlook emails and I found out about imaplib. I just wanted to know that what if my office365 has another layer of security to it which needs an organisation login from a service like okta verify or authenticator? Will I be able to access my emails using imaplib?

languid blaze
#

what's the easiest way to do http requests in jenkins? for some reason we're not using groovy.

rapid sparrow
vocal pewter
#

Do you have curl?

languid blaze
#

Good question.

alpine horizon
#

I noticed that there is an API that logs each request to AWS Cloud watch, and there is at least one log each millisecond, and I think the logs are slowing it down a lot,
is there a way to save the logs in memory and print everything each N logs instead of printing each logger.info() immediately?

tepid light
# alpine horizon I noticed that there is an API that logs each request to AWS Cloud watch, and th...

The docs about logging handlers might give you some ideas, the one about queues look interesting but I haven’t used that one myself: https://docs.python.org/3/howto/logging-cookbook.html#dealing-with-handlers-that-block

silent sedge
alpine horizon
alpine horizon
silent sedge
#

stdout where? Container?

#

systemd?

brazen forge
#

or just… CW agent

torn blade
#

logging.TRACE = 5


class BeeLogger(logging.Logger):

    def __init__(self, name, level=logging.NOTSET):
        super().__init__(name, level)
        logging.addLevelName(logging.TRACE, 'TRACE')

    def trace(self, msg, *args, **kwargs):
        self.log(logging.TRACE, msg, *args, **kwargs)


logging.setLoggerClass(BeeLogger(level=logging.DEBUG)) # error

how do i pass the logging level here?

short peak
torn blade
#

setLoggerClass only takes class

short peak
#

your __init__ has name and level

torn blade
#

that instantiates the logger no ?

#

i think logger is a singleton

short peak
#

shouldn't it be something like BeeLogger("bee_logger", level=logging.DEBUG) ?

#

also, paste the error please

torn blade
#

yeah if i use the level i also need to supply a name

#

but the original code goes like logging.setLoggerClass(BeeLogger)

willow pagoda
torn blade
#

does it propagate when i have several files with their own getLogger(__name__)?

vague silo
#

depends on which logger you set it to

#

if you set it in a logger called myapp then myapp.mymodule will use that yes

astral turret
#

Paramiko : Error reading SSH protocol banner

#

how do i solve this error?

carmine scroll
#

Why does Python Docker SDK list a few images but not visible in Docker Desktop or Terminal (docker image ls)

import docker

client = docker.from_env()
print(client.images.list(all=True))
[<Image: 'helloworld:latest'>, <Image: ''>, <Image: 'python:slim'>, <Image: 'hello-world:latest'>]

But in the terminal it's not shown:

scripts> docker image ls
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
scripts>
thorn portal
carmine scroll
#

I wonder if its running on different instances

thorn portal
#

potentially, could you describe your setup a little bit?

rapid sparrow
#

in python you run with all=True argument, it is -a in CLI
if u will remove in python all=True, it will match as without -a in CLI

carmine scroll
rapid sparrow
thorn portal
#

hmm okay let me rephrase, are you pointing to the same docker daemon in both cases?

carmine scroll
rapid sparrow
carmine scroll
#

In the old SDK examples we had to set it, now I'm not sure

rapid sparrow
#

also daemon is overridable by DOCKER_HOST env var, so if something sets it, that means it got changed to smth else from deafult

#

how to check same in Docker Desktop or Python CDK, is a different issue ^_^

carmine scroll
#

docker context ls lists 2 endpoints. As you said Docker Desktop has it's own endpoint with a *. I'm guessing Python is using the default endpoint

#

client = docker.from_env()
Something should be done here

rapid sparrow
carmine scroll
#

Oh

rapid sparrow
#

Docker daemons are often existing at different servers / VMs

#

the only answer is checking running servers/VMs if u want to gather all working docker daemons

carmine scroll
#

I'm working on an Ubuntu VM locally. Not connecting to the outside network

rapid sparrow
#

anyway, just check Server Docker Daemon for Python CDK configured
and compare with Server Docker Daemon in CLI (docker version command / docker context ls)

then u will see if they are running with different daemons

rapid sparrow
carmine scroll
carmine scroll
# rapid sparrow hmm? what ensures virtualization

Just a Boxes VM to completely separate my PC's setup. Basically I want to use Python to setup several docker containers on low power SBCs for an IoT project. So, I'm using VMs to just simulate a new OS install

rapid sparrow
carmine scroll
rapid sparrow
#

you mention Docker Desktop, where it appears

carmine scroll
rapid sparrow
carmine scroll
#

Yes, I have installed Docker desktop on a Ubuntu VM

rapid sparrow
#

so, you have two VMs

#

Docker Desktop running on Ubuntu VM
and Boxes VM running Ubuntu VM 2

#

each VM is obviously having separate docker daemons ^_^

carmine scroll
#

No. Gnome Boxes has an Ubuntu VM, this Ubuntu VM has docker desktop and python docker sdk running on it

#

I'll just create another VM without docker desktop and see it it works properly

rapid sparrow
#

ah, u installed Docker Desktop inside Ubuntu VM that is running inside Gnome Boxes?