#tools-and-devops

1 messages · Page 61 of 1

night quest
#

Just connect your RPi with the network which has access to the Internet

steep temple
#

Will the Rasberry pi automatically create a wifi?

night quest
#

I don't know anything about network device in RPi, maybe it's possible to create WiFi network

steep temple
#

Ok

#

But still thank you

night quest
#

Your welcome

topaz flint
#

is there any good resource on openStack

visual ridge
#

how to approve own pull request?

warm pollen
#

There is no way in github to approve your own PR

visual ridge
warm pollen
visual ridge
#

Im the owner

low zephyr
#

Not sure if this is the right channel for this but i have a github project where i have certain tags based on priority and i want those issues tagged with it to be moved to a certain project column, is that possible?

visual ridge
#

Hi, whats the best liscense to put on my github repo if i want to give all permissions to the users like every permission except i dont want to be responsible with what they do

#

and no warranty

tawny temple
#

MIT is the most common choice.

#

The BSD license give you some more choice since there are 4 of them.

visual ridge
#

ok thanks

#

Also how can I delete an already pushed commit?

#

I know re writing history is bad but I leaked my creds

leaden tartan
#

then force push'

visual ridge
#

I ran git reset --hard c8533afbdf9e6de01c66e54f99ad5ba390ab6a05

leaden tartan
#

I dont think you need the whole commit hash

#

just the first 6 should do

visual ridge
#

oh alright

#

thanks

visual ridge
#

Hi, I currently have 2 branches main and dev. Whenever I commit into main, I also want the commit to be present in dev. Basically auto-merge when a commit into main is made

tawny temple
#

It's likely achievable with git hooks, but I've not tried something like this myself.

#

Why do you want this?

#

Depending on frequency of commits, you may just end up with an insane amount of merge commits.

visual ridge
#

Because the dev branch should be the latest & greatest. If I am commiting or pushing to main, it should also be present in dev

tawny temple
#

I think you got it backwards. You should be working on branches and then merging those branches to master.

#

Well, I guess it's "main" now, not master

visual ridge
#

Alright, thanks

tawny temple
#

You can avoid merge commits by rebasing instead, but this will be disruptive to anyone using the dev branch because it will re-write history. So it's practically not an option.

visual ridge
#

Alright

leaden tartan
#

oh nvm

#

you did mention it later

heavy knot
#

is it at all possible to use google home, but instead of google home's voice its your voice speaking back at you?

ripe pollen
#

Any idea how to connect gitlab to aws pipeline. working on building CI/CD. But Gitlab is not available on aws pipeline as a source.

mystic mango
#

is it possible to override pip install command? why it does not runs setup.py install?

tawny temple
#

What is it doing instead

mystic mango
#

I am trying to customize package installation

#

it seems to ignore setup.py

#

I tried using cmdclass arg of setuptools.setup()

#
import setuptools
from setuptools.command.install import install


class InstallDecorator(install):

    def run(self):
        pass
#

it still installs the package

#
setuptools.setup(
    name='...',
    packages=['...'],
    install_requires=requirements,
    version='1.0.0',
    author='...',
    author_email='...',
    description="...",
    long_description=long_description,
    long_description_content_type='text/markdown',
    url='',
    cmdclass={'install': InstallDecorator},
    classifiers=[
        'Programming Language :: Python :: 3 :: 3.8',
        'Programming Language :: Python :: 3 :: 3.9',
        'Operating System :: OS Independent',
    ],
    python_requires='>=3.8,<4.0',
)
#

it seems pip install != setup.py install

#

ah it runs setup.py install for source distributions but only after installing all dependencies

#

but I need to override dependencies resolving

visual ridge
#

for some stupid reason .gitignore isnt working, my ide automatically creates a folder but when i try to add that to .gitignore it dosen't work. Heres my .gitignore

__pycache__
.git
.vscode
.history
/.idea
/gwatch.exe
credentials.log
tempCodeRunnerFile.py

$ git status

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   .gitignore
        modified:   .idea/.name
no changes added to commit (use "git add" and/or "git commit -a")
sly sleet
#

@visual ridge

primal basin
#

for running an app on gcp VM, does anyone know which host i should put when i run superset run -host {????} -p 8088 ? i've tried the VM's internal & external IP but the UI is still not loading when i run http://{??????}:8088 on my browser (outside of the VM)

storm hedge
#

I'm not familiar with gcp, what OS is the VM running?

primal basin
storm hedge
#

and what os are you running to try to connect to the port?

primal basin
storm hedge
#

ok, I'm not super familiar with mac, altho I use one at work, I just wanted to know what tools you have to work with

#

do you know if Debian has a firewall running? if you type 'which ufw' or 'systemctl status firewalld' in the VM do you get any output?

#

or rather, what output do you get?

primal basin
storm hedge
#

hmm ok. how about 'uname -a' in the VM?

primal basin
#

Linux druid-query-1 4.9.0-14-amd64 #1 SMP Debian 4.9.246-2 (2020-12-17) x86_64 GNU/Linux

storm hedge
#

oh sorry I missed the notification you replied. one moment plz

#

seems like Debian would be running ufw if anything, for a firewall. So let's try as root or with sudo in the vm terminal 'ufw allow 8088/tcp'.

#

if you get no output, then run 'echo $?' if it returns '0' the command worked. Please restart your application and try connecting from your laptop again

#

I'm not sure if your mac would block a port from being open or not, so I will need to let someone else answer. Good luck!

primal basin
pine fern
#

if i have a dockerfile uploaded to my repository

#

my teammates would need to 1) download, 2) build the container, 3) run the container

#

is that how docker works?

tawny temple
#

Yes, that is one way.

#

If in the context of development, then usually one does need to build the container locally so that the container has their local changes.

#

However, images can be published to a registry like Docker Hub and users can pull images from there without having to build them.

pine fern
#

i see

visual ridge
shy plank
#

I'm using Docker BuildKit, and have the following RUN command

#
RUN --mount=type=cache,target=/root/.cache/pip pip install --no-cache-dir -r requirements.txt
#

problem is that the dependencies don't get cached because I have --no-cache-dir. Is there anyway to cache the dependencies outside the container, while not having them cached inside to reduce image size?

tawny temple
#

That seems odd. Is it really true that it will also store the cache in the image?

#

The cache mount should be an external mount

#

You cant use no cache dir because that tells pip not to write anything to the cache

open horizon
#

can anyone help how to solve this error

sly sleet
#

what's your pylint version

stable orbit
#

In order to run my python program, I need java installed in the system (I'm using jpype). Now, I'm trying to dockerize this program. How can I install and use java in the image in an effective way? I know I can just use from ubuntu and install jdk in it. But I want to obey best practices.

I have tried FROM openjdk:11 as base and copy from it but couldn't make it.

wooden ibex
stable orbit
# wooden ibex you will need to install OpenJDK into Python Container or Python into OpenJDK co...

Okay, I have installed jdk in a python based image. For multi-stage building, how can I copy the jdk into another stage? No boilerplates, just jdk? I have tried copying from /usr/lib/jvm/java-11-openjdk-amd64/bin/java but seems like it's not enough. jpype needs libjvm.so too and I don't know how many other dependencies it has and unfortunately it's very time consuming to find out manually

wooden ibex
#

You copy your own code

#

you do not copy stuff like that

#

apt get install or whatever works your image

#

your final container will need JDK and Python interpreter

stable orbit
#

But, for example, for the sake of lower image sizes, you first install python dependencies in one stage and copy these packages into final image. I just want to apply this for java too. If you say it's unnecessary I can understand. I just want to do the best practice

wooden ibex
wooden ibex
#

it's single stage build

wooden ibex
#

that's if you have stuff to compile

#

you haven't made it there

#

And your docker container is going to be a mess, you are throwing in Java nightmare

#
Python⇒Speed

When you’re choosing a base image for your Docker image, Alpine Linux is often recommended. Using Alpine, you’re told, will make your images smaller and speed up your builds. And if you’re using Go that’s reasonable advice. But if you’re using Python, Alpine Linux will quite often: Make your builds much slower. Make your images bigger. Waste you...

stable orbit
#

Okay thank you, there are lots of articles

wooden ibex
#

and really, storage space isn't that expensive these days

stable orbit
#

I mean, I run install default-jdk and it installs fontconfig amd64 2.13.1-2 [405 kB] etc which is unnecessary. I don't know if openjdk has these, but you get the point

heavy knot
wooden ibex
wooden ibex
heavy knot
tawny temple
#

The selling point of alpine is that it is a minimal image. So if you're not concerned with space then you shouldn't be using alpine anyway due to its other downsides mentioned in the article.

visual ridge
#

How to avoid merge commits when merging main to feature branch?

#

i pushed to main instead of feature

tawny temple
#

Rebase rather than merging

visual ridge
#

ah so how would i rebase to merge commits from main to feature?

tawny temple
#
git fetch origin
git switch feature
git rebase origin/main```
pine fern
#

ive successfully 1) built and 2) ran my docker container with my app

#

docker desktop shows its all good

#

i think, however, ive messed up the ports. it has a flask component which is supposed to use port 5000

#

and ive also exposed that port in the dockerfile

#

but when i try to open it locally, its not connecting

visual ridge
#

Also how to amend particular commits that I have already pushed, I made a couple of spelling mistakes. For example a commit 6 commits ago, how would I do that?

finite fulcrum
#

an interative rebase is probably what you want here. You can also fixup the old commits with the small changes and then autosquash, although I haven't used that myself

leaden tartan
orchid tartan
#

Hi,

I am a QA Engineer and I am trying to learn docker. I understand that docker allows you to specify a specific step-by-step way to set up your project such that anyone can have all the requirements needed to setup and run such project on any machine at any given time without worrying about anything else.

As a QA Engineer, my challenge is that I get stuck trying to get a chrome driver and a selenium library to be included in the script such that it can run. Who can help get past this obstacle? More importantly, who can break it down for me like I am a novice because I think I have got myself confused.

vale wedge
vale wedge
vale wedge
orchid tartan
vale wedge
#

no private chat for now

orchid tartan
# vale wedge no private chat for now

Ok, so what I have tried to do was bash into the base image say python:3.7-stretch, then see if I can run everything from there but I get stuck at the point of getting a chromedriver and selenium

tawny temple
#

You need to write a Dockerfile.

#

If you just install stuff in a shell in the container, it only applies to that specific instance. That's what a container is - an instance of an image.

#

Writing a Dockerfile enables you to build an image from which you can spawn containers consistently

orchid tartan
tawny temple
#

Installing selenium shouldn't be any different in Docker than it would be on your local machine.

#

Granted there are some optimisation that can be done to make the images smaller but don't worry about that for now

orchid tartan
tawny temple
#

Yeah. You can use pip if you're using the python base image.

orchid tartan
#

Thanks @tawny temple the next issue is the chromedriver or geckodriver, how do I install it globally?

tawny temple
#

I'm not familiar with installing it, but why would following the standard installation instructions not work? Also, have you checked if someone else already published an image with it in Docker hub or another public registry?

vale wedge
#

@orchid tartan as i said earlier, i wouldn't include any selenium driver into the test images, and instead use one of the official selenium driver images

orchid tartan
#

@vale wedge Thanks

ocean current
#

Hey guys - if it helps, we created a Django starter project generator. And this includes Dockerfile and docker-compose...so you might be able to simply reuse this. https://github.com/imagineai/create-django-app

visual ridge
#

Hi, my docker file is in Project/docker. I want to add everything in Project, how would I do that?

pine fern
wooden ibex
fervent inlet
#

If anyone here is familiar with linux machines, I can't get pip to work. It returns an error /usr/bin/python3: No module named pip

abstract arrow
#

Can you try python3 -m ensurepip

fervent inlet
#

Alright

#

/usr/bin/python3: No module named ensurepip

abstract arrow
#

If not, try the package manager, ik on Ubuntu it can be done with apt install python3-pip

fervent inlet
#

I'm on kali but I'm pretty sure it's the same

fervent inlet
abstract arrow
#

What happens when you run the suggested command?

fervent inlet
#

Hold on lemme send a pic

abstract arrow
#

Text should be fine

fervent inlet
#

this happens

#

Oh I figured it out

#

I had to click tab

#

I was stuck on this part

abstract arrow
#

Or space usually

#

Or enter, I think there is multiple ways

fervent inlet
#

Alright anyways, what do I do when it says this:

abstract arrow
#

Tbh, it might not be a good idea updating the system. Due to what kali is used for

#

It's usually a set toolkit

#

So updating might cause issues

fervent inlet
#

But pip won't work without updating it?

abstract arrow
#

Well is this a vm?

fervent inlet
#

Mhm

abstract arrow
#

Give it a try, worst that can happen is a remake of the vm

fervent inlet
#

Alright

abstract arrow
#

Also, if you require more help it might be worth grabbing a #❓|how-to-get-help to clear up this channel. Please ping me if you do

fervent inlet
#

Ok it printed a couple lines in terminal and updated successfully I think

#

There's still one problem

#

It still says there's no module named pip

#

Alright I did sudo apt-get install python3-pip and I think it may've worked

#

Alright it worked

wooden ibex
#

Kali comes with few packages. It’s designed for those who know security and Linux

#

Just as FYI

frozen wagon
#

oy

#

oy oy oy

#

how can i re-route a nginx request to a docker container

#

like

#

i got nginx running on my sever but the web server is a docker container

wooden ibex
#

You need Load Balancer

echo tusk
#

Been away from the language for a long while, only did some parsing mainly so nothing too deep. I see there's a lot of virtual environment stuff now, any recommendations or tips to keep the bloat down for multiple projects?

visual ridge
#

Hi, whats the best workflow for github? Others make pull requests into the dev so if I want it in main then whats the best practice? To wait like 5 more pull requests and make a pull request from dev to main? Or rebase it, how do you do it?

tawny temple
#

Sounds like what you're describing is the "git flow" workflow.

#

It seems unnecessarily complicated. You can just target main directly with your PRs.

raven talon
#

Need help with Django channels ERROR:-ValueError: No application configured for scope type 'websocket'

visual ridge
#

Hi, how can I link specific places in readme.md? I have seen others do it, it looks like this: https://github.com/user/repo/README.MD#place-1

#

in github

leaden tartan
#

@visual ridge github (and most markdown parsers) automatically convert all headings to links. So basically you have to start the line you want to link with # (number of hashes depend on whether you want the link to be an <h1> all the way through <h6>).

wintry iris
#

is there a way I can download the wiki for my repo

#

github ofc

short peak
torpid rapids
#

How do i restore to a previous commit in git using command line

#

to restore old files during commit?

#

nvm i did it

visual ridge
#

Hi, how to open a pull request and merge it again? i accidently deleted the merge pull request thing

proud trout
#

is there a way to get around this in the postgres docker image?

#

I want the entry point scripts to always run when the container starts

night quest
proud trout
#

the entry point only runs when the data-folder is empty

#

how will changing the image entry point make it work even tho the db has data

night quest
#

I mean - remove conditional execution of this code

proud trout
#

ah

#

I guess I need to find a simpler solution

#

thanks for the help tho

night quest
proud trout
#

maybe I need to change my implementation

night quest
proud trout
#

I have folder which has .sql files responsible for creating tables in the database.
I have this as entry-point

    volumes:
      - ./bot/postgres/tables:/docker-entrypoint-initdb.d/```
I want tables to be created whenever a new `.sql` file is added to the folder without erasing data (`docker-compose down --volumes`)
#

I have a discord bot connecting with the db with the help of asyncpg

#

maybe, I should create the tables using asyncpg instead of the entry point

night quest
#

You can execute new .sql files already after creation from Python container but store them in docker-entrypoint-initdb.d directory too to recreate database after container restart or something

proud trout
#

right

past token
#

Hi everyone, this is my first post in Python Discord so I'll try not to make it stupid. Does anyone have experience using locust for load testing? I'm looking for a framework for perf testing, and locust keeps popping up (and please let me know if this is not the right channel for this question). Thanks!

heavy knot
#

Hi, i'm trying to put these two scripts into separate instances but VSCode is giving me a hard time letting me do that. any suggestions?

brisk lake
#

anyone else having real slow poetry downloads on wsl2

#

ubuntu20.04 if it matters

sly sleet
#

windows filesystem or linux filesystem?

lucid tangle
#

this is the best place im guessing to put this question

#

yknow how programs can associate themselves with a file ending

#

how can i do that with a script

tawny temple
#

Depends on the operating system.

#

Also I wouldn't say this channel quite fits your question. Don't get too caught up in the idea that all questions have to fit a topical category. Not all will, and that's why we have general help channels for you to claim.

#

Eh I suppose close enough, I'm not gonna argue over it. Anyway, on Windows, it would be set by modifying the registry. You wouldn't even need to use Python to change it. You could use the registry editor or create a .reg file and execute it once.

lucid tangle
#

Alright thank you

pine fern
#

if i dockerize everything, i will eventually get better at docker right?

tawny temple
#

Probably

pine fern
#

unless i learn bad docker habits then itll be too late later on DoggoKek

wet spruce
#

Hmmm

#

I recently had to reinstall python

#

and the problem is with pip

#

at the moment, pip3 works but pip is broken

#

' Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources'

#

this occurs every time I try to use pip

#

and all attempts to reinstall pip yield: pip in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (21.0.1)

lone linden
#

has anyone included html - that is generated by coverage.py - in sphinx docs?

#

i've tried a few possibilities but im struggling a bit

lone linden
#

actually, just included the entire coverage dir into _build/html/_static/ and included it via a raw html directive, so it's not that difficult 🤷

livid bloom
#

Anyone know web or library or editor plugin that can show how a Python code flowing in the background (show sequences in arrows & tables)?
I've seen it but forget where is it.

violet hatch
#

I have a webapp consisting of a Django backend and Angular frontend.

#

right now everything is in the backend repo (Angular served as static files)

#

and I manually build the frontend and copy it over

#

how could I set it up as frontend and backend in two separate repos, and each time I push either, I run a frontend build if necessary, updating the combination of the two, and deploy it?

#

I’m not even sure where to start tbh

livid bloom
wooden ibex
#

and it's two docker containers, one with Nginx/Angular which is built via multi stage docker and other being django

violet hatch
bleak ether
#

how do i pass a string from one github actions step to another

#

i know i can hard code them as an env variable if i know what it is apriori but something that comes out of a build step

wooden ibex
violet hatch
#

sounds better from a devops perspective

wooden ibex
#

yea, just make sure your angular app endpoints are configurable

violet hatch
#

where do you host?

#

and is it very complex? I haven’t done this kinda thing much tbh

wooden ibex
#

at work? We are moving to Kubernetes

violet hatch
#

I mean, which provider

wooden ibex
#

We use GCP at work

violet hatch
#

hm.

#

okay I’ll think about it

#

thank you!

wooden ibex
#

I'd consider something like Digital Ocean though

violet hatch
civic walrus
#

Any ideas what I am doing wrong?

apiVersion: apps/v1
kind: Deployment
metadata:
  name: user-deployment
  labels:
    app: user-service
spec:
  selector:
    matchLabels:
      app: user-service
  replicas: 2
  template:
    metadata:
      labels:
        app: user-service
    spec:
      containers:
        - name: user-service
          image: sneakykiwi/hyplex-user:v0.0.1
          ports:
            - containerPort: 100
---
apiVersion: v1
kind: Service
metadata:
  name: user-service
spec:
  selector:
    app: user-service
  ports:
    - port: 100
    targetPort: user-service
#
error: error parsing deployment.yml: error converting YAML to JSON: yaml: line 9: did not find expected '-' indicator
analog kiln
#

I hope it's kinda tooling.
I have a docker related question. How would one do the following?
I have a file with 100 ids. My script reads the file and randomly selects 20. Those it then uses to send messages to message queue. I dockerized it with the file and it works fine. I see messages from those 20 ids in the queue.
I would then like to spawn another container (from the same image), and have it to use different 20 random ids.
How would I communicate between them which Id's from the file are still available?
Have the file in shared volume, instead of container, and maybe write another file with already used ids? I'm not sure that would be "safe", when the containers will spawn both at once. My goal is to be able to spawn up to 5 containers to use all the 100 ids.

leaden tartan
#

that solution looks pretty good to me, what's the problem? @analog kiln

analog kiln
#

I'm not sure, how fast the read/writes will be, if the 5 containers will be started at once. It may also result in some weird output in the "used_ids" file, righ?

empty widget
#

does anyone here have any sort of experience with sneaker bots or auto fill tools??

ebon swift
#

Is there a tool available that will allow you to see which files your team have changed in another branch? Something to speed up communication to prevent conflicts

#

Preferably in the IDE itself (Jetbrains)

night quest
wooden ibex
gentle apex
#
version: "3"

services:
  app:
    container_name: apptest
    env_file: 
      - test.env
    build: 
      context: .
      dockerfile: ./test.Dockerfile
    depends_on: 
      - mongodbtest

  mongodb:
    image: mongo:latest
    container_name: mongodbtest
    env_file: 
      - test.env
    environment:
      MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME}
      MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD}
      MONGO_INITDB_DATABASE: ${MONGO_DATABASE_NAME}
    ports:
      - ${HOST_PORT}:${CONTAINER_PORT}

seems the environment vars from test.env isnt exactly loading because i'm getting this error

docker-compose -f docker-compose.ci.yml up --abort-on-container-exit --exit-code-from app
WARNING: The MONGO_ROOT_USERNAME variable is not set. Defaulting to a blank string.
WARNING: The MONGO_ROOT_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The MONGO_DATABASE_NAME variable is not set. Defaulting to a blank string.
WARNING: The HOST_PORT variable is not set. Defaulting to a blank string.
WARNING: The CONTAINER_PORT variable is not set. Defaulting to a blank string.
ERROR: The Compose file './docker-compose.ci.yml' is invalid because:
services.mongodb.ports contains an invalid type, it should be a number, or an object

not sure whats causing it

leaden tartan
still fjord
#

Does anyone know a simple way of starting the depended container before building the application?

version: "3.9"
services:
  reiz:
    build: . 
    ports:
      - "8000:8000"
    volumes:
      - .:/app
    depends_on:
      - "db"
  db:
    image: edgedb/edgedb:20210320022940b2b91d
    ports:
      - "5656:5656"
    volumes:
      - ./data/db:/var/lib/edgedb/data
    environment:
      - EDGEDB_PASSWORD=edgedb

The dockerfile for the application itself consists from many steps, and from like step 7+ it requires database access. Though when I run docker-compose up it tries to build the application image without actually starting the depended database. Any ideas?

tawny temple
#

Docker itself has no knowledge of when an arbitrary program it's executing is in a "ready" state.

#

You're doing this in a build but I don't see why polling wouldn't work in that context too

still fjord
tawny temple
#

I misunderstood then

#

Thought the problem was that one just starts earlier

heavy knot
#

Hey I'm on Arch Linux and I'm trying to install Spyder but I get a dependency cycle. I know it's from vim and python but I really don't want to uninstall my vim RC files

#

Any ideas?

wicked bane
#

guys how to create a new folder in desktop by using linux terminal

#

any idea or is it impossible?

wicked bane
#

??????????????///

wet spruce
#

@wicked bane can't you just $ "cd desktop" and then $ "mkdir nameGoesHere"

wicked bane
#

no such file or directory

#

it doesnt work

wet spruce
#

with the CD or the mkdir?

wicked bane
#

yea it wont

#

try on ur sys too

wet spruce
#

I don't use linux xD

heavy knot
#

How can I download tools from github and use it?

sly sleet
#

@wicked bane cd ~/Desktop then mkdir folder_name

orchid crane
#

Hey I just had a quick question, I'm getting back into python after a while. I'm wondering where the best place is to install python modules?

sly sleet
#

just use pip

#

to install from pypi

wooden ibex
#

Most people just use PIP

dense oak
#

someone who use visual studio code and github help me pls

visual ridge
#

Hi, when I doing git add . It gives me a warning

The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in myfile.

It replacing LF with CRLF breaks my html, js and css pages. How to stop this from happening? I am on Windows

tawny temple
#

Create a .gitattributes file in the root and add the following to it ```
*.html text eol=lf
*.css text eol=lf
*.js text eol=lf

If you want all text files to always be LF you can do `* text=auto eol=lf`, but this imposes line endings on Py files too, which some contributors may find problematic.
tawny temple
#

A gitattributes file is better to use when working with other people, but you could also configure it on your local machine by chaning the core.eol setting and core.autocrlf. I believe the former would be lf and the latter false to force everything to be converted to lf on check out.

#

Or maybe autocrlf needs to be input... not sure.

visual ridge
#

got it

primal basin
#

what (free) programs do you all use for those fancy architecture diagrams?

rare monolith
#

Hi, does anybody have experience using invoke with python-based build automation tools like doit or luigi?

turbid tusk
#

Im trying to play music through speech, this is the code:

import pyttsx3
import speech_recognition as sr
from playsound import playsound
import multiprocessing

r = sr.Recognizer()

def take_commands():
    try:
        with sr.Microphone() as source:
            print("Listening...")
            voice = r.listen(source)
            info = r.recognize_google(voice, language='en-in').lower()
            return info
    except Exception as e:
        print(e)
        print("Say that again sir")

def Speak(audio):
    engine = pyttsx3.init()
    voices = engine.getProperty('voices')
    engine.setProperty('voice', voices[0].id)
    engine.say(audio)
    engine.runAndWait()


if __name__ == '__main__':
    while True:
        command = take_commands()
        if "exit" in command:
            Speak("Exit now")
            print("Exit now")
            break
        if "play" in command:
            p = multiprocessing.Process(target=playsound, args=("play.mp3",))
            p.start()
            cmd = take_commands()
            if "stop" in cmd:
                p.terminate()

Even though the music plays I haven't figured how to stop it or better pause it by just saying "stop". What's the easiest way to do that?

primal basin
heavy knot
#

Hello guys, I'm new here and in this language. I learned the basics of python a few weeks ago and I want to improve my knowledge in that language, knowing that I already know the basics will there be any free course that I am recommended to take?

cyan ermine
#

check out freeecode camp @heavy knot

median drift
heavy knot
turbid tusk
heavy knot
#

i get you. when using pygame mixer,when you speak in the midst of music playing, you can call mixer.pause() to stop playing and listen to commands being spoken.

#

Just code it to record for input when you press a hotkey or some button so that it doesnt always listen for anything being spoken.

heavy knot
#

Thanksss

vivid notch
#

Heard from some of my peers that pyinstaller will allow you to run a script(s) on a machine that doesn't have python installed. In a nutshell how does this work?

#

I gather that pyinstaller 'brings' all the information that's needed to the new machine, but doesn't need to install python?

#

From a 25k feet view, how is something like this possible?

#

Does it make a docker container or something?

civic grove
vivid notch
#

Hey, thanks for the response. Interesting, forgive me, but what do you mean by the python interpreter?

civic grove
#

Python Interpreter is what allows you to run python programs

vivid notch
#

ok, and Python Interpreter is on every windows machine?

civic grove
#

PyInstaller “packages” that with the program you’ve written

vivid notch
#

Right

civic grove
#

Python interpreter is not on every windows machine

#

It is what you download from the python website

warm pollen
#

But yes

civic grove
#

When it’s already in a .exe form, the program will not have to download anything

#

Because the interpreter is basically inside it

vivid notch
#

I'm hearing conflicting things here.

civic grove
#

Okay so here’s how it goes

#

First you download python from the website

#

Then you write your program

#

Using the python you downloaded you can install a package called pyinstaller

#

Now to run pyinstaller you need python

#

When you use pyinstaller on the program that you’ve written it will make a .exe file

#

In windows at least

#

Now with this .exe file, you won’t need the python you downloaded again

#

You can just run it pretty much

#

And it also will not download anything unless if your program is a program that downloads something

#

This is possible because the python you downloaded in the first place is “copied” inside the .exe file or whatever file pyinstaller produces

vivid notch
#

Ah, ok, so the .exe 'brings' python over to the new "python-nieve" machine

civic grove
#

Yeah

vivid notch
#

And then, when the .exe is clicked, it installs python in, idk, a "temporary dir" -or- just places it in memory?

civic grove
#

Yeah it doesn’t install it if i remember correctly and just directly executes it so it’s just in memory i believe

vivid notch
#

That's wild!

#

Slow, I'm sure, in comparison to having it installed 'traditionally'

#

but so cool!

civic grove
#

Yeah i don’t know most of the intricacies but that’s the basic gist of it

vivid notch
#

Thank you!

limpid mural
#

Hey guys, - I've just finished creating my first proper project but researching how to deploy is leaving me totally overwhelmed. I'd like for me and a colleague in a different country to be able to run the script from anywhere. I'd like to do it as cheaply as reasonably possible and I would prefer it if the source code wasn't externally accessible. Originally I was planning just to upload the scripts to some shared hosting I have and use PHP to create a little web-based UI for it, but it turns out my plan doesn't allow me to install python on the server. I'm happy to do lots of reading and learning but with all the information out there about AWS, Kubernetes, Docker Containers, VMs and stuff I don't know where to begin. Can anyone point me to a starting point?

pine fern
gleaming notch
#

hmm, dockerize your app, if the hosting provider has some sort of k8s platform then it's all easy afterwards.

limpid mural
#

Forgive the ignorance, but k8s = ?

gleaming notch
#

kubernetes

limpid mural
#

Duh

#

Thanks 🙂

gleaming notch
#

probably the best place to learn k8s that I have found https://learnk8s.io/blog/what-is-kubernetes

limpid mural
#

Thanks - I've been plugging away at the google tutorials, but I think I'm getting to the limit of my understanding so any resources are 100% appreciated

hardy jay
#

Hi All, I have small python program that I would like to transfer to multiple computers, but I don't want to spend the time to install Python and the various modules necessary to be able to run it

#

Is it possible to package the installation of those into one executable source?

median drift
median drift
tawny temple
hazy veldt
#

idk where this question fits in but why does it show this error when i try to play sounds

/usr/bin/python3 /home/chrispy_/os.py
Traceback (most recent call last):
  File "/home/chrispy_/os.py", line 2, in <module>
    playsound('startup.mp3')
  File "/home/chrispy_/.local/lib/python3.7/site-packages/playsound.py", line 92, in _playsoundNix
    gi.require_version('Gst', '1.0')
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 129, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gst not available
chrispy_@penguin:~$ /usr/bin/python3 /home/chrispy_/os.py
Traceback (most recent call last):
  File "/home/chrispy_/os.py", line 2, in <module>
    playsound('startup.mp3')
  File "/home/chrispy_/.local/lib/python3.7/site-packages/playsound.py", line 92, in _playsoundNix
    gi.require_version('Gst', '1.0')
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 129, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gst not available
hasty urchin
#

Has anyone had the problem that you have a hand full "applications" that you develop and all of them use some libraries hat have been developed internally. The libraries are deployed to a private repository. So when you need to extend a lib for new case in one/more application/s, you have to, import it differently (ex. with pip install -e), do the change, build and deploy the lib, then all other applications have to be retest to be sure that no unwanted sideeffect happed... This is kinda tedious. Anyone having this problem? And maybe an idea for a better approach?

strange mortar
#

Do you do automated regression testing?

dawn gulch
#

versioning ?

wooden ibex
wicked bane
#

how do we get out of pygame infinite loop
whenever i click the pygame x button it says not responding

lethal nest
#

Hey guys, I've build a django application that runs daily resource-intensive data analysis tasks via celery workers. These tasks can take hours to complete since they use beefy machine learning models.
I'm wanting to deploy this onto AWS such that when I run these analyses, the resources scale proportionally (the tasks need lots of memory and a GPU). I looked into deploying the api onto an ec2 instance and using redis with fargate tasks to offload the periodic heavy processing. However, the tasks need to access Django's ORM so I'm not sure if that solution is possible.
Does anyone have any suggestions on the best way to architect this? Any help is appreciated.

wicked bane
#

is it possible to increase pixel size in pygame??????????????////////

heavy knot
#

Any docker experts?

#

I keep getting permission denied when running npm run dev

gleaming notch
#

how are you creating the docker image and running it? Do you mind sharing your Dockerfile?

#

and the Dockerfile?

#

WORKDIR /home/node/app --?

#

USER node --?

#

FROM node:8
USER node
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin
WORKDIR /home/node
COPY package.json .
RUN npm install --only=prod
COPY . .

#

the above Dockerfile seemed to have solved it for guys.

#

try on your local machine, perhaps?

#

hmm, donno much about docker-compose though.

slate silo
#
import re

def check_links(content):
    pattern = re.compile(r'(http|ftp|https)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?')
    matches = pattern.finditer(content)
    if matches:
        for match in matches:
            if str(match.group()[0:20]) == 'https://discord.gg':
                print(match)
            else:
                print(match)

random_links = "https://stackoverflow.com https://www.youtube.com https://www.youtube.com https://discord.gg/"

check_links(random_links)

hi i want this to print the link name if it comes across a discord link but i am not getting an error but still it isn't printing the link name someone pls help

#

can someone pls help

sly sleet
#

just do match.group().startswith("https://discord.gg")

floral grove
analog kettle
#

If I make a branch, make a commit on that branch, then delete that branch, is that commit gone?

#

apparently not

#

(which is what I want, actually)

hardy jay
#

Hi everyone

#

Is it possible to automate input into a website

#

for example, if had to input certain information everyday to get a file from a website, but I wanted to automate that process, is that possible?

#

will Selenium be able to do that?

iron basalt
#

however it seems that even unreachable commits aren't deleted immediately, and you can recover them

#

If deleting the branch would make commits unreachable, git should warn you though and require the force flag

analog kettle
#

@iron basalt thanks, it sounds like your understanding lines up with the explanation I found

#

the use case is that I have my resume as a latex document in a git repository, and I want to know the version that I sent to each listing. The goal was to have them indefinitely without having to have so many branches, but I guess I can just delete those branches once I no longer care about how that application turned out.

iron basalt
#

I think you want tags

#

That would allow you to keep a reference to a commit with a description

analog kettle
#

I thought tags were specifically part of GitHub

iron basalt
#

No, github's releases integrate with tags, but tags are a git concept

analog kettle
#

so is a tag a reference to a commit that doesn't move when a new commit is made?

iron basalt
#

Its a reference to a commit with some optional description attached to it, and you can checkout a tag like you'd checkout a branch

#

And list all tags in the repo

#

So if you wanted to mark a commit with something like "Applied to Deloitte with this revision" then I think tags are exactly what you want

analog kettle
#

@iron basalt that sounds interesting. Thanks!

iron basalt
#

yea no worry

analog kettle
#

What I'm googling for the moment is what happens if you make a branch, make a commit, tag that commit, and then delete the branch

tawny temple
vocal quiver
#

How can I download the contents in a requirements.txt file using pipenv. Thanks

iron basalt
vocal quiver
#

Thanks I'll look at that

velvet spire
#

why does pipenv hate me

#

I have pipenv and pyenv installed, and i somehow have been having so much trouble with them

#

i installed pipenv from apt

#

oh now its this error

velvet spire
lone linden
#

does anyone the code quality widget in conjunction with gitlab CI?

#

for the life of me, it does not work, and as far as i can tell, it doesn't work for anyone

spice blaze
#

How can I make a python package that includes a .net core executable? That is, if someone were to install my package, it would build the executable from source so that my python code can use it.

agile lark
#

Any good terminal-based debugger for Py? I found pudb but would like some more recommendation

crimson stump
#

any terraform geeks here?

heavy knot
#

@candid kayak so i can host my bot forever

#

on the lowest spec vm

#

for free

candid kayak
#

Technically yes

#

The lowest spec VM has like 600 MB of memory

heavy knot
#

i wanna be sure tho

#

thats plenty i feel

candid kayak
#

If your bot grows, it quickly won't be enough

heavy knot
#

oh yea

#

i forgot about servers

#

ill just buy a rpi

candid kayak
#

I run postgresql and my bot on that lowest end VM and it's a steady 3-4% of CPU usage only

heavy knot
#

ooof

candid kayak
#

My bot is for a few private servers only though

heavy knot
#

mhm my bot is public and is alr in 25 servers

candid kayak
#

You can get more performant VMs for not too much

heavy knot
#

as i have a ups so power cuts wudnt be an issue

candid kayak
#

The rpi will be limited by your internet connection speed

heavy knot
#

100mbs?

candid kayak
#

Can't say how it'll behave

heavy knot
#

that should be enough but it'll probably cause high pings

#

okay!

#

thanks alot 🙂

candid kayak
#

👍

rare tiger
#

Hi guys - I'm looking for a way to run 'virtual IoT devices' - I want to make some applications that interact with IoT devices, but I have no IoT devices to test on. Anyone know of any software/solution that lets me setup virtual cameras, sensors, etc?

#

preferebly something free I can run on my own PC.

vale wedge
dense rose
agile lark
visual ridge
#

Hi, github is saying I have conflicts but I do not understand..

civic grove
#

i tried setting up a mysql server that runs on docker locally and it asked for a password even if i dind't even set up one yet

#

lol i checked the logs and it had this

#

how would i rerun it so that i have the option of specifying my password

vale wedge
civic grove
#

yeah i know how to destroy it and make a new one, i don't know how to make it allow me to specify a password though

#

docker run --name=[container_name] -d mysql/mysql-server:latest this is the command that i ran and it just makes the container and randomly generates a password haha

vale wedge
civic grove
#

right thanks i'll check that out

vale wedge
#

hmm, based on what i see, its not nicely documented

#

btw, is there a specific reason to use mysql (my personal experience puts postgresql miles ahead)

#

@civic grove ah, the official images suggest to grep the logs for the password, yikes

civic grove
#

oh i'm just learning how to use docker haha

vale wedge
civic grove
#

although i might actually just use postgres

vale wedge
#

yikes

topaz aspen
#

anyone had an issue with vscode and poetry? I can't seem to get it to use the poetry env as the python interpreter

vale wedge
#

every time i read something mysql its all pain and wtf again

civic grove
#

hahaha

#

at least it's working now

#

i'll learn postgres now since those things you've mentioned sound bad

#

i do have a question though

#

if i put data in this running mysql container or anything db really, will it retain the data as long as I don't delete the container?

vale wedge
#

yes, in general there is a strong suggestion to create separate volumnes for databases

civic grove
#

neat

vale wedge
civic grove
#

do ya'll use docker as you main environment? by that i mean you don't install anything directly into your device(language, framework-wise) at all and just use docker

candid kayak
#

I install languages, but use databases with docker

#

But maybe that's because I'm a docker rookie

tawny temple
#

Though it is possible to do what you say. I remember trying out a visual studio code feature that launched the entire program in a container and supported remote debugging, etc

#

Container could even be remote

#

(I tried it by running it on a VM on my local network and exposed the Docker socket)

civic grove
#

That sounds nice

#

the reason i am asking is because my laptop has quite a small ssd and programs are kinda hard to configure on windows

#

if i configure docker to just live in D drive (for the images and containers at least) then i won't have that problem

tawny temple
#

Why couldn't you just put your files on D directly

civic grove
#

i have to check out that remote feature though, i might have a use for my chromebook if that's viable haha

#

also are there any other useful Dev/Ops tools i should check out apart from docker/containers?

tawny temple
#

Git or any other version control software

#

Grep or similar (cause windows search sucks)

#

Scoop/chocolatey on Windows. Makes it significantly easier to manage and update installed programs

civic grove
#

nice i do know fundamental git already, i'll check out grep

#

i don't even use chocolatey anymore i just do everything in wsl2 haha

heavy knot
#

hello i have a question

#

how can create tools for hacking for Example in kali linux

#

with Python

rancid schoonerBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious or inappropriate. Do not help with ongoing exams. Do not provide or request solutions for graded assignments, although general guidance is okay.

heavy knot
#

i am sorry bro until now don´t use discord and i wanna advice me someone😪😪

night quest
tiny jackal
#

does anyone have a shout out wall code if not its fine

#

just so i dont need to code it

quiet grail
#

hey all, i have a win2016 server.. i've played with ci/cd in gitlab to a gitlab runner but is there any windows applications that can check my gitlab and download scripts and run them? i've been doing this manually and thinking of automating this, but is there something that already exists and does this? looking for something simple where i can push from gitlab (or pull from the windows server) and it'll just run the script

#

and i can rdp to the server and see it running just as if i opened a cmd prompt and ran the script

astral vigil
#

Does anyone have a recommendation for a linter to use for pull requests in git? I recently discovered this feature, and I want to play with it, but there are a ton of options and I am not super excited about researching all of them.

celest stag
#

Hi all, I want to learn python for pen testing/CTFs, can anyone give me some ideas or point me in the direction of different project ideas?

velvet spire
#

bro why

#

why why why

#

anyhow, I'm trying to set up git with github.

#

I just initilzed a git repo and created a github and im having a lot of a trouble

#

please ping me if you have any help

#

fwiw, I'm using visual studio code and trying to use that with git, so its doing everything for me, but im still having issues!

deep estuary
velvet spire
#

ha

deep estuary
#

do you use master or main

velvet spire
#

good question

#

that happened earlier

deep estuary
#

uh

#

just run git branch

velvet spire
#

I tried some of this but nope!

deep estuary
#

oh right

#

wew

#

this looks a bit mucky

#

ah

#

alright so

velvet spire
#

nuthin'

deep estuary
#

your local git probably initialised with master

velvet spire
#

very mucky

#

and for what its worth

#

I can delete both the github and the local git repo shit

#

because i have had 5 successful commands so far

deep estuary
#

probably best to recreate, yeah

velvet spire
#

total

deep estuary
#

not the github repo

#

just the local copy

#

do

#

rm -rf .git/

#

and then git init -b main

velvet spire
#

lmfao

deep estuary
#

and then uhh

velvet spire
#

its okay joe~~

deep estuary
#

ih

#

you're on

#

uh

#

do git --version

velvet spire
#

debian linux

#

2.20.1

deep estuary
#

oof

velvet spire
#

am i out of date

#

HOW BAD IS IT

#

tell me I can take it

deep estuary
#

2018

velvet spire
#

okay see you soon

deep estuary
#

lol

#

no need

#

can work with this

#

so uh

#

okay so

#

do

velvet spire
#

!remind 3y git should be in date now

rancid schoonerBOT
#
Out of the question.

Sorry, you can't do that here!

deep estuary
#

rm -rf .git/ again

#

then copy the commands exact from this box, can use the clipboard icon

velvet spire
deep estuary
#

oh yeah lol

#

then yeah just do that block

velvet spire
#

no thanks lemme update git apparently

#

it just hates me

deep estuary
#

hm

#

how is it initing a repo without a branch

#

I'd say update git in this case and try again, not knowledgable enough in git-fu to try work around the stuff in this version

forest flame
#

I still use github desktop

velvet spire
#

oh hold on

velvet spire
next scroll
#

sudo apt update && sudo apt upgrade

deep estuary
#

hmmm

#

seems 2.20 might be the raspi default

velvet spire
#

^

velvet spire
deep estuary
#

latest is git 2.31.1

velvet spire
#

wtf

#

I have git 2.20.5 on my debian buster install

#

the ubuntu install has the latest of 2.25

#

which is also the one that's firewalled so I need to configure a reverse proxy on it smh

#

no wait

#

debian buster is all 2.20.1 sheesh

#

guess I gotta build git on 3 machines at least

velvet spire
#

or, most of them

#

frick i had the console open to the wrong machine

#

still building

#

I'll let you know when its done joe

#

kek

#

@deep estuary updated git

velvet spire
#

are you

#

i

#

bro

#

i think i got it to work

cedar plover
#

Hello

#

I am trying to figure out why my "pip list" in my conda environment

#

returns the same result as pip list on a global scope on my computer

#

did I mess something up?

#

😦

#

I'm trying to keep all of the dependencies for each project isolated in each conda venv

warm tiger
#

how about this

#
conda list```
#

does it also have the same libraries

cedar plover
#

no it doesn't have anything

#

interesting

#

so I guess pip list isn't bounded by conda env

#

should I be using conda install within each conda env to keep them separate?

#

Seems to be the case

warm tiger
#

pip is the python's package manager

#

and conda is the

#

well

#

conda's pm

warm tiger
#

virtual environment is a blessing upon pythob

solemn wasp
#

hello guys, (not sure if this is the right channel to ask this, in case no, lmk and I'd remove my q)
does anybody use meld to save (stage) changes?
I'm not sure what part of the setup I'm doing wrong but meld as difftool is working good
but at the moment I decide to save (stage) changes, those are saved in tmp file and not in the actual ones
I'm talking about staging unstaged changes on tracked files (no untracked files)
I'm using meld from flatpak so I call it like this:
$ flatpak run --file-forwarding org.gnome.meld \"@@\" $LOCAL \"@@\" \"@@\" $REMOTE \"@@\"
any help? or maybe meld is not for that purpose

cedar plover
#

okay this is a stupid question but conda seems to take a lot of space on my m2 ssd

#

it should be possible to just put everything on my d drive

#

and run everything from there right?

#

I guess I should just uninstall it

#

I don't really have any projects on this computer anyways atm

#

🤔

quiet grail
#

hey all, are there any windows applications that can check my gitlab and download scripts and run them? i've been doing this manually and thinking of automating this, but is there something that already exists and does this? looking for something simple where i can push from gitlab (or pull from the windows server) and it'll just run the script in a cmd prompt that i can check on when i rdp to the windows machine? i've looked into ci/cd but i don't need separate images or environments, just looking to easily run small scripts..

tawny temple
#

I think it'll be easier to set it up in CI

#

You want your server to pull and execute the code whenever something is pushed to the repository?

quiet grail
#

ideally, or even have it check my local gitlab instance every 30 mins and if there's a new version, download that and run it

tawny temple
#

Yeah, if you do it on the server you'd have to write an application that either polls GitLab for changes or, if available through an API, receives events from GitLab.

quiet grail
#

i've played with a gitlab runner but feels like a waste to spawn a new docker or something just to run a tiny script.. in my case, multiple tiny scripts

tawny temple
#

If you instead do it in CI, all you need to do is scp the files and ssh into the server to execute a run command.

quiet grail
#

is that different that using a gitlab runner?

#

my workflow now is when i commit a change, i rdp to the machine, download the new ,py script and run it in a cmd window

tawny temple
#

Well, no cause isn't the runner the environment in which CI jobs are executed?

quiet grail
#

yeah.. i have gitlab runner/workflow working fine, but if i have lets say 8 scripts that do something basic (but separate) i don't need separate docker containers for each

tawny temple
quiet grail
#

i'll look into that, thanks.. but i was kind of hoping for something that would maybe run it on the windows environment so i can rdp in and easily see all the scripts running and their output at the same time

tranquil laurel
#

Hey anyone know if i use heroku free plan, will i need to add billing info even id they won’t charge me anything? Because i don’t have a credit card

tawny temple
#

That's essentially what using SSH will do

#

It will connect to the Windows server and you'll be able to run build commands within the Windows server.

quiet grail
#

ty mark, i'll look into it

quiet grail
#

hmm, getting closer.. i have windows gitlab runner setup as shell executor. job is deployed to the runner, as far as i can tell windows commands are working but it's not finding my python installation.. any ideas?

Checking out fc77364b as master...
git-lfs/2.13.3 (GitHub; windows amd64; go 1.16.2; git a5e65851)
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:01
$ echo "This job tests something"
This job tests something
$ python test.py
python : The term 'python' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.

quiet grail
#

nvm got it. need to pass full python path

#

thanks!

quiet grail
#

last question if anyone is around.. ci/cd to a windows runner is now working but from gitlab i can't see any output from my scripts (print statements in the python scripts). is there any way to show this? i've verified the scripts themselves are running

civic grove
#

I have a possibly dumb question. So i started learning (by doing things with it) docker yesterday and i encountered a problem. I installed an image and ran it so now i have a container. When i added a package in that container using its own package manager(think using pip to install packages) it did it successfully but when i exited from the container and used docker exec again to execute the container, the package i installed previously disappeared. I googled this and found out i have to commit the container and push the image.

The question is what’s happening in the background that I have to do this(commit and push)?

night quest
visual ridge
#

Hi, how do I delete one commit without losing the commits ahead of it?

finite fulcrum
#

Depends on what you mean with delete, you can revert the commit which will introduce a new commit reverting its changes; or rebase and drop which will delete it from the history (and will have to redo all the subsequent commits so they'll get a new SHA)

quiet grail
#

does anyone know how to run a gitlab pipeline/job forever? i'm realizing this is maybe not the intended usage of gitlab pipelines.. but i have a job that is running a script and i want that script to run 24/7 is it possible? it seems the max timeout is 1 month before gitlab will fail the job

velvet spire
#

@deep estuary so I figured out most of the git issues from last night, but I'm having another issue with it. I'm trying to be able to push to a firewalled server over ssh but its not working how it should, full issue below

#

basically, I have my server here at home, and a firewalled server elsewhere that can't get from github, so....

My local server needs to clone its repo to the remote server, but I cannot use git clone on the remote server since it does not have remote access to me. The only way of access goes from local to remote server, it can not connect back to me.

I'm not sure if my format for adding the remote directory is correct or not, and I do have ssh access set up for local to remote.

EDIT I'm using vsc -git integration

mortal panther
#

hello! I am currently building a CLI tool to share, update and sync GitHub Actions workflows across multiple projects. Python projects support is one of the main goals.

The idea is to create a pack of workflows that work right out the box for any Python project, yet can be easily modified.

So, my question is: does anyone have a good idea how to figure out what linting/testing/type checking tools to run on git push?

For now the best solution I have is: pip list | grep flake8 && flake8 etc. Do you have any other ideas?

iron basalt
#

Python Discord projects use Actions for CI/CD, maybe you could look at the workflows for inspiration?

mortal panther
#

thank you! yes, something extremely close to lint-test.yml, but the idea is to figure out what checks to run based on installed dev dependencies

iron basalt
#

Usually the main branch is protected by a workflow that will install dependencies, run lint & test

#

And new commits on master trigger a release that builds an image and pushes it somewhere

mortal panther
#

yes, i see, it also builds artifacts...

iron basalt
#

Sounds like an interesting project, but I'm probably not experienced enough to help you beyond this point

mortal panther
#

omg, this is actually a great idea to cache PYTHONUSERBASE instead of ~/.pip/cache. caching pip cache does not speed up installation at all

#

thank you for directions!

valid stratus
#

Any chance for some help regarding virtual envs?

mortal panther
#

i can help

quiet grail
cedar plover
#

should I install jupyternotebook globally or only in my conda env?

#

I feel like for this global should be fine

#

since I can use it for every project 🤔

#

thoughts?

pine fern
#

filepath errors but in gcp

#

i guess i cant use gs://[bucket name]

#

it worked when i read it in with pandas

uneven fern
#

pycharm is being a pain here, i moved the two files in a sub folder and its giving me this error (though the program runs fine, i dislike the red text that has no option to be ignored)
does anyone know what can i do here?

PS sorry if this is the wrong channel for this kind of thing

iron basalt
#

it may be confused about how your project is structured

#

if your program entry-point was tessellations/main.py then you would have to do from quad_trees.Quad import Quad

#

but I don't think you're doing that because I don't think quad-trees (with the dash) would even be a valid module name

#

so if your main is e.g. quad-trees/main.py the import path is correct, but pycharm may not understand that

opaque kettle
#

does anyone recommend buying kite pro? I've been using the free version for a while now but it's kind of hard to tell if im actually benefiting from it or not considering I hit my daily limit pretty quickly

prime grail
#

Hey, I am trying to bite a problem in the butt before it happens. So I am hosting a bot and I want the bot to be scaleable. The bot by itself does not need to interact with any databases it only requests from an api. I've heard about things such as Kubernetes would this be something I should look into for this?

prime grail
dense oak
#

someone here use google cloud?

tawny temple
#

Is a distribution of load something that is possible for your bot?

#

Let me rephrase: does your bot require all network traffic to be received in order to function or can it work with only some of it?

median drift
wooden ibex
prime grail
prime grail
median drift
prime grail
wooden ibex
#

Sharding won’t help if bot gets stuck in Asyncio nightmare

prime grail
#

Ok, so I guess my question is should I still use docker containers? Or is there any auto deployment things that could help.

wooden ibex
#

You don’t have DevOps problem software design issue. Containers won’t matter

prime grail
rough marlin
#

I have the weirdest problem.

#

My entire project folder is read only

#

when I unset it, it gets set back

#

I think git might be doing it

#

I'm on Win 10

rough marlin
#

Ok, problem solved: I closed a bunch of stuff, including explorer windows

#

now it works

#

I think Windows isn't very good about informing the user why something is failing

sly sleet
rough marlin
#

Yeah I wouldn't be on it if I had a choice.

velvet spire
#

git checkout -q source-module
error: you need to resolve your current index first

#

@deep estuary

deep estuary
velvet spire
#

👀

velvet spire
deep estuary
#

¯_(ツ)_/¯

velvet spire
terse cargo
#

Is pyenv widely used?

#

I would like to set up a local python environment so I don't have to worry about Gentoo policy when trying to get stuff to work with Python.

ocean mica
coarse bluff
#

does anyone know a discord server which is specifically for tools/devops/editors?

meager ore
#

How do i repeat similar steps acorss multiple sheet in powerBI?/

wooden ibex
iron basalt
#

keep in mind that pyenv manages python installs, it's not a replacement for virtualenv

#

there is also pyenv-virtualenv, which extends pyenv to manage python installs and virtual environments

terse cargo
#

Thanks everyone.

cyan bridge
#

I already have python 3.9 and python 2.7 installed on my Mac. Now how would I use pyenv. Do I need to delete my existing python versions?

ocean mica
cloud elbow
#

task does not get registered on queue (docker)

#

what do I do?

iron basalt
#

You system installs can live alongside the pyenv-managed ones

vast forge
#

i tried to upgrade my pip and the upgrade broke it , it won't work anymore i run windows 32 bit

visual ridge
#

Hi, how to do continuous deployment for a dedicated vps? I am using SSDnodes

#

with github

livid cloak
#
config = ConfigParser()
config.read('config.ini')
print('Logging out')
LoggedIn = False
config.set('main', str('LoggedIn'), LoggedIn)```

error:
`Traceback (most recent call last):
  File "main.py", line 97, in <module>
    config.set(str('main'), str('LoggedIn'), LoggedIn)
  File "/usr/lib/python3.8/configparser.py", line 1200, in set
    self._validate_value_types(option=option, value=value)
  File "/usr/lib/python3.8/configparser.py", line 1185, in _validate_value_types
    raise TypeError("option values must be strings")
TypeError: option values must be strings`
rancid schoonerBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

livid cloak
#

How do I make it a string?

#

str() dosent work

#

Please ping me when you reply

#

If you reply

vast forge
#

says's the same no module named pip

night quest
rugged drum
#

Hello everyone! I decided to try combo of pyenv and poetry. But I have some troubles with adding dependencies(
I've already created the question on stackoverflow: https://stackoverflow.com/questions/66776560/cant-add-any-package-with-poetry-while-using-pyenv?noredirect=1#comment118247643_66776560
Maybe someone can help me with my situation?

viral marlin
umbral jay
#

Got a question about github. I've got a local repository using github. I wish to add files from another folder to this local repository. Can this be done? Is it necessary to have all files in a repository within the same folder?

sly sleet
#

@umbral jay

vast forge
vast forge
vast forge
#

Oh it's just a path variable problem

#

nvm fixed it thanks

spare rapids
#

Hello there #tools-and-devops friends!
I've come down here for a possible big ask.

Could anyone here help with Git in general? In both the broad and specific senses that is. I understand the concept and how it's supposed to function, but I'd like to have a more in-depth explanation behind how each command (pull, push, commit, etc.) works, how remote servers come into play, and any tips/tricks to help in sending timely and (mostly) error-free code (for a pull request on Github for example)

P.S.
(be sure to ping me, i'm usually all over the place)

night quest
spare rapids
#

I have, it's just not exactly the ideal way for me to learn. I do better with someone who can actively correct me.
Trust me, I've tried, it's just not it.

elfin ether
#

How about trying out these commands

night quest
#

Bot looks very helpful

#

I am afraid that interactive learning can be costly for someone to give detailed explanations to you

spare rapids
#

Understandable, I appreciate what you've given @night quest and @elfin ether

#

Back to the grind then >:O

terse cargo
#

I'm looking to set up my development environment after years of inactivity. I use vim. I used to use pathogen with vim and some other plugins I don't remember. I was just wondering what's good with vim plugins nowadays.

#

I am probably going to have to relearn a bunch of stuff but I hope I am up for the task.

heavy knot
heavy knot
#

I'd start there :)

#

sorry: favorite vim plugin site:reddit.com

#

choose your preference, but the plugins are cross-compatible in a lot of cases

terse cargo
#

What?

heavy knot
#

didn't you want to know which plugins people are using these days?

#

sorry, if I wasn't clear. write the above into your search engine and you will get some hits on reddit

#

look for the ones dated from 2 years ago (to now) and you should find plenty of plugins and reasons why people use them

#

that's how I search for new plugins anyway

terse cargo
#

Thank you for the suggestion.

heavy knot
#

it's nothing special, but it might give you a few ideas

terse cargo
#

Thank you I appreciate it.

heavy knot
#

🤘

crystal kayak
#

What's the community consensus on using pipenv? I like that it combines pip and virtualenv, but afaik it doesn't use requirements.txt, and I see everyone use requirements.txt. Is it just not that popular vs virtualenv / venv?

heavy knot
#

Can't tell you about community consensus, but I'm pretty satisfied using pyenv and venv for personal projects

wooden ibex
#

I use venv with development docker containers.

wooden ibex
#

I would recommend you stick with simplified solution until it can't handle it and you are stuck with increasing complexity.

ivory echo
#

I want to make a ddos ​​tool using python. Is there a resource I can learn how to do this?

heavy knot
#

is it alright to answer questions such as these?

#

you don't really need a resource

#

you need to learn what a ddos attack is

#

then it's fairly obvious

#

just know that if you decide to attack networks other than your own, you could face repercussions

vital spear
#

i Uploaded a pip package to test someting out

#

and it uses webbrowser

#

this is what happens when Itry to install that packege

sly sleet
#

because webbrowser is in the stdlib

#

meaning you dont need to depend on it

#

@vital spear

#

tip: before uploading to pypi, try installing it locally first via pip install .

vital spear
modern steeple
#

Hi everyone! I'm trying to get a CI/CD flow going for my personal Python projects. I'm getting familiar with the language, but not so much yet with the tools around it.
I develop on my Mac using PyCharm. I have two linux systems in my network and two in the cloud. I want to use them as "test" and "prod" and deploy to them python apps in docker containers. I would deploy on the local linux machine or the cloud ones depending on use case. I'd also like to use GIT and a pipeline to get familiar with the process.
Could you recommend me what tools I need to learn and tie together to make something like this work?
Thank you!

median drift
modern steeple
modern steeple
mortal cosmos
#

@modern steeple do you want the CICD to build the container, deploy, both or something else?

rocky gorge
#

where can i learn python for free ?

median drift
crystal kayak
rancid schoonerBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

crystal kayak
modern steeple
#

I think i've identified the tools i need - pycharm for coding, flake8 and mypi for linting, pytest for testing, bitbucket and bitbucket pipelines for building the pipeline. I'm having trouble understanding how to best wire them together and who should do what. For example how much should i drive from Pycharm and how much from the pipeline.

crude lynx
#

i would like to update to jupyter lab 3, i need to write a command in a dockerfile, does anybody has experience with docker?

crystal kayak
#
FROM ubuntu:20.04
RUN apt-get update apt-get install -y python3-pip
#

or:

FROM python:3.9
#

After that you can run a pip install command like so:

#
RUN pip install jupyterlab
crude lynx
#

thank you:)

torpid ermine
#

how would i go about making a pip package with optional params, example pip install mypackage[async] to install the async version.
what's the term i should search for to get started with this cause google failed me >.<

tawny temple
#

Or "Extra dependencies"

torpid ermine
#

thank you :D

chilly panther
#

does anyone know how to force nano to convert spaces to tabs? (something like reverse -E) search shows only - E

sly sleet
#

don't use nano :P

chilly panther
#

eh if i could use anything else then i would do so

eager owl
#

anyone with VS Code able to paste the key for Computer\HKEY_CLASSES_ROOT\*\shell\VSCode\command

#

gone and edited the wrong key like a muppet haven't I

snow sage
#

Hi, accidentally commited and pushed some code containing some rather private information I would rather not disclose
I used the BFG thing (or whatever it was called), but it didn't get rid of anything, it just duplicated the commits. It worked fine on my test repo, but on my actual one it didn't work as intended and I'm not sure what's going wrong. I followed the instructions on the docs.
Anyone have any idea what's wrong?

tawny temple
#

Where did you push it to? GitHub?

snow sage
tawny temple
#

What you can do yourself is remove the commit from any branches. What you can't do is completely delete it from GitHub's servers. Even if a commit is "dangling", GitHub keeps it around.

#

To truly delete it, you'd have to contact GitHub and ask them to do it.

#

To just remove it from branches, use an interactive rebase to drop the commit.

#

Then force push

snow sage
#

Not updating the file directly, but you can browse the files at the history of those commits I think

tawny temple
#

You can drop as many commits as you want.

snow sage
#

Thanks!

#

Just another question: if I drop all the commits then my local repo would still be the same as I had left off before and I would be able to commit all of those files again, so basically nothing would change except I just have less commits?

#

@tawny temple

tawny temple
#

Yes.

#

Though you don't necessarily have to re-do anything (but maybe it's easier for you than trying to salvage what you had before).

snow sage
#

K ty

tawny temple
#

Instead of dropping commits, you could stop and edit commits.

#

That would let you remove sensitive info from the diffs and keep the rest.

snow sage
tawny temple
#

With an interactive rebase too. Just edit instead of drop

brave nova
#

idk which channel fits my question, so I am asking it here
isn't with open(file, "w") as f: supposed to create a file if it wasn't found?

#

if so, then why am I getting an error saying that the file wasn't found?

tawny temple
brave nova
#

ok thx

#

and sorry

neat wagon
#

Does anyone know why I can't seem to list the GPG keys I've generated?

#

I've created a key pair on GitHub using Kleopatra with RSA-4096

#

Uploaded the public key etc

#

But it doesn't seem to list anything

heavy knot
#

I want to write an app on microservices with minikube, so I have these questions:

  • How should I organize the git repos? Currently I'm leaning towards putting each service into its own branch of the same repo
  • I managed to utilize docker hub's autobuild, but how can I automatically update the service images in minikube? I found Flux, but that thing seems too complicated for me to quickly get into
    Feel free to ping me if you have something to tell, I will probably forget that I asked here
nocturne raft
#

Hi, is it possible to mount a single file in host to container and vice versa?

#

instead of explicitly copying the files back and forth

crystal kayak
#

If so, it sounds like you want a bind mount:

#

Example: docker run --mount type=bind,source="$(pwd)"/target,target=/app python:3.9

warped latch
crystal kayak
#

You can also do it in a docker-compose.yaml like so:

services:
  app:
    build: app
    volumes:
      - ./host/path:/container/path
crystal kayak
warped latch
#

Thanks you.

nocturne raft
warped latch
#

Should I listen to this guy's advice, particularly about python and alpine linux builds?

burnt thunder
#

too many links on that page, but yes, alpine builds will be slow, unless alpine wheels now exist

#

there is a PEP for that

warped latch
#

I see. I started with uhh python:3.9-slim

They are just local links for navigation for the most part, its a pretty well organized manifesto, I just dont know who to believe about alpine

#

Today is my first day trying to do docker

crystal kayak
burnt thunder
#

essentially, python sppeds up installation of things by having prebuilt "wheels", which are platform specific in most cases. But there is no wheel platform for alpine linux yet, so you have to build from setup.py/pyproject.tml/setup.cfg

warped latch
#

eh, no thanks. Im a pip-tools requirements man.

burnt thunder
crystal kayak
warped latch
#

that sounds like what i read

burnt thunder
crystal kayak
#

Plus it's small enough as it is, imo

warped latch
#

Ive literally never used setup.py files before to do anything in python is all.

#

I dont really understand the approach because I just use requirements and venvs to install

burnt thunder
#

setup.py is what things like flask use so that they get installed correctly using pip

warped latch
#

I just started doing this today since it seems important for this to be more thorough.

Mainly what Im hoping for is to find a better approach to server config and app deployment that isnt a headache. I dont have a lot of experience with prod servers. Im learning with a vps though lately

#

Ive spun test servers of vm before but not front facing ones

crystal kayak
#

You're definitely on the right track with learning about Docker then. I'd recommend their Quick Start guide. Really helpful.

#

docker compose is super helpful

#

And then just play around with it!

warped latch
#

cool, its just a lot to digest, but if i can systematically eliminate server config hell, I would like that

#

What Im trying to do is Django, gunicorn, nginx, postgres

#

I have the django + nginx + gunicorn in an early state.

#

it works on dev server

crystal kayak
#

If you're not already familiar with environment variables, check those out too.

#

And when you set up a docker-compose, or simply run a docker container on its own, you can specify the environment variables (aka env variables)

#

That way the container will know if its in a developer or prodution env, and you can change how it behaves accordingly

warped latch
#

right.

#

A guide is saying to init a boilerplate django project withsudo docker-compose run web django-admin startproject composeexample . but I dont need to do that, I have a django app to work with.

#

Whaat is the significance of initting the project this way

#

I used docker build to make a container without postgres or docker-compose. Do I need to abandon that container?

crystal kayak
#

To me that just sounds like an example to try out, to see what Docker is like

warped latch
#

ah ok

warped latch
#
volume:
  - /opt/data:/var/lib/mysql

This means... the path on the vps will become the path in the container?

crystal kayak
#

So any files you have in that dir on your VPS will appear in your container when you run it. If files are edited in /var/lib/mysql in your container, those changes will be reflected in /opt/data immediately on your VPS. Even once the container has finished, those updated files will stay in /opt/data.

small echo
#

Is anyone using poetry with docker?

#

I read good things about poetry but the recommendation is to install using curl|sh.... Or their get-poetry script. Why not easy_install??

tawny temple
#

I believe they have their own installer to avoid conflicting dependencies with an existing Python environment

#

Since you're in Docker, you should have a fresh environment and shouldn't need to worry about any of that

#

So you can just install poetry directly with pip

small echo
#

I want to use the lockfile to make sure I install the correct versions of transient dependcies. And poetry export doesn't work correctly.

tawny temple
#

In what way does it not work?

small echo
#

I get missing packages with i use pip -r requirements.txt when I install the resulting requirements.txt and also it doesn't register the extras like mongo[tls]

#

Somehow it neglected to install certifi

tawny temple
#

Is certifi in the lock file?

small echo
#

It is

tawny temple
#

And if it's not including extras that may be a bug so you should look into reporting that to them.

small echo
#

Amd in the resulting requirements. I didn't have time to look into that but the missing extras on pump go was enough to tools down on that approach

#

Extras on pymongoo