#tools-and-devops

1 messages Β· Page 49 of 1

drowsy lava
#

so what is my vimrc

#

I look at the dir in the github thing

#

it says vimfiles

#

and i'm in it

dusty maple
#

It should be on C:\Users\YourUser\_vimrc

#

If it doesn't exist, you have to create it

drowsy lava
#

there is something called vim info

dusty maple
#

Nope, not that one

drowsy lava
#

so i'll just make one then

dusty maple
#

Yeah

drowsy lava
#

so can I copy and paste

#

between firefox and vim?

#

yes I can

#

alright then what's next?

#

have to reload it

dusty maple
#

Yeah

drowsy lava
#

didn't work

#

it says

#

what's .vimrc

#

I named it _vimrc

#

@dusty maple

dusty maple
#

what's .vimrc
That's the alternative one, typically that one isn't read

drowsy lava
#

huh

dusty maple
#

Also that's not how you install a plugin

#

You have to add it like this

drowsy lava
#

like how?

dusty maple
#
call plug#begin()

Plug `morhetz/gruvbox`

call plug#end()
drowsy lava
#

huh alright

dusty maple
#

Then reload vim, and do :PlugInstall

drowsy lava
#

alright let me try it

#

so as long as I have the plug.vim file inside autoload

#

it should be fine right?

#

it still didn't work

dusty maple
#

autoload inside of vimfiles in your user folder, yeah

drowsy lava
#

it didn't work tho

#

it isn't working

#

i'm not sure what to do

soft hare
#

ping me when you guys r done, i have a git question but no rush and dont wanna interrupt

dusty maple
#

Sure

drowsy lava
#

So what can I do?

#

sorry but could this go a bit fast it's getting late

dusty maple
#

I'm not sure what went wrong

drowsy lava
#

hmmm

#

should I uninstall vim and reinstall it again

dusty maple
#

I suggest re-running the vim-plug installer

drowsy lava
#

I did

#

I deleted the files

#

and reused the code

dusty maple
#

Right, and it did install on vimfiles?

drowsy lava
#

yeah

dusty maple
#

Hmm, am running out of ideas

#

Right, if the plug commands still don't work, I'm really not sure where the problem is

drowsy lava
#

hmmm

#

I'll reinstall vim them

dusty maple
#

@soft hare I think we can start with the git question

drowsy lava
#

yeah lol

#

I give up

tawdry needle
#

@drowsy lava i told you to use packadd

#

:he packadd theres a whole chapter in the docs

#

Works for vim 8+ and neovim

soft hare
#

i cloned origin/master and made 2 local commits - how do i revert back to what i cloned, and then back to where i am rn?

#

hmm i think i can do git checkout master^^ and then git checkout master

finite fulcrum
#

Ideally you'd work on something that's not master

tawdry needle
#

@soft hare that works, or ^2, or look at the log to get the actual commit hash

finite fulcrum
#

I'm not quite sure what the ^^ does, but you can checkout to the origin or the exact commit if you wanted

tawdry needle
#

git log --graph --oneline --decorate is your friend

#

Keep in mind that if you check out a remote tracking branch or a specific commit by hash, you will end up with a detached HEAD

#

So you might need to create a new branch starting from wherever you've just checked out

finite fulcrum
#

If just viewing that should be fine, but if you need any changes just use proper branching

soft hare
#

ahh

#

yeah i'm just viewing

#

running tests after compiling python gave me an error

#

so i wanted to see if it was my changes at fault

#

it's not πŸ™‚

#

so now idk what to do :/

heavy knot
#

Where do you guys keep your prometheus.yml file in the project?

#

Also is there a way to override the settings in the original prometheus.yml file from the project directory?

lime island
#

Hey everyone! I made a beginner/intermediate cheat sheet for Git! There's a light mode, dark mode, and it's in different formats: DOCX, ODF, PDF, and PNG.

You can get it at the GitHub repo I made for it: https://github.com/MikeRodeman/Git-Cheat-Sheet

I hope it helps someone!

eager cedar
#

Anyone has an idea how to do auto deployment when a new image is added to a docker registry without having to do it from your pipeline?

This should already exists, but otherwise I guess I would have to setup a small HTTP server that I can then run a deployment script on the server when the HTTP server gets pinged by a GitHub Actions webhook?

tawny temple
#

Is watchtower what you're looking for?

cyan raft
#

hey so i was implementing the reddit library into a twitter bot i was making (using python ofc) and after doing pip install praw i imported the module but my ide keeps giving me the following error

tawdry needle
#

@lime island I think you should clarify that reset works by moving HEAD and making changes corresponding to where HEAD moved to, based on soft/mixed/hard

#

I also think your descriptions like "getting rid of changes made" are unclear and imprecise

#

But otherwise this is good

#

I also don't love your description of revert; opening the editor is a side effect of making a commit. The real functionality is that you're making a commit that undoes a previous commit

lime island
#

@tawdry needle Thanks! I just started learning Git so I don't know much yet! I'll look that stuff up and learn about it πŸ™‚

tawny temple
#

I'm revisiting my git aliases. Any of you have helpful ones to add to my collection?

pastel aurora
#

Looking for suggestions for a dev environment, any help? All the ones in the iOS store I could find look like crap, if nothing is available for iPad, my pc is windows ten. Any help is appreciated?

eternal flicker
#

@tawny temple I have one for git status because I run that command ritualistically, much like I do ls after cd

tawny temple
#

Thanks

#

That log one may be useful. Not sure

#

I usually use pycharm for it

abstract hound
#

uhh any idea why mypy doesn't like this?```python
from abc import ABC, abstractstaticmethod
from typing import Any

class Class(ABC):
@abstractstaticmethod
def method(arg: Any) -> None:
pass

async def work(self) -> None:
    self.method(1)```

mymy.py:11: error: Too many arguments for "method" of "Class"
yet it passes just fine if I remove the -> None in work:python def method(arg: Any) -> None:which makes absoutely no sense to me, it's like the @abstractstaticmethod is making it choke

#

is it because the deco is deprecated?

#

nvm, I guess that's part of the reason

drowsy lava
#

the gruv box color scheme doesn't show up

#

anyone know why?

eternal flicker
#

do you get any errors?

#

do you have another colorscheme set anywhere else?

drowsy lava
#

no errors

#

when I do :colorscheme gruvbox

#

it goes through but nothing is changed

#

everything stays the same

#

I have no idea why

#

it's so wacky

eternal flicker
#

try uninstalling and reinstaling gruvbox?

  • Remove the Plug '...gruvbox' line
  • Exit, open vim and run :PlugClean
  • Add the plugin line again, but this time put it as Plug 'morhetz/gruvbox'
  • Exit, open vim and run :PlugInstall
drowsy lava
#

alright let me try it

#

It didn't work

#

I'm not sure why

#

I reinstalled it like you said

#

but nothing happened

#

the WSL one works lol but WSL is hard to deal with since I can't run selenium on it

#

which is really annoyin

#

considering so many projects of mine require selenium

eternal flicker
#

what terminal are you using?

drowsy lava
#

the one from microsoft store

#

windows terminal

eternal flicker
#

does calling set termguicolors solve the issue?

drowsy lava
#

I put it in the .vimrc file?

eternal flicker
#

yep, where your other settings are

drowsy lava
#

yes it does

#

YAY

#

I have no more thing tho

#

the noerrorbells part

#

it has an error bell anyways

eternal flicker
#

it should be off by default, try removing that line?

drowsy lava
#

nope

eternal flicker
#

right, what do you mean by has an error bell? does it ring? flash?

drowsy lava
#

ring

#

like it doesn't have that slight ding sounds

eternal flicker
#

doesn't have?

drowsy lava
#

what

eternal flicker
#

like it doesn't have that slight ding sounds
doesn't have? does that mean you want the ding sounds?

drowsy lava
#

No

#

I don't want the ding sounds lol

#

it's very annoying

eternal flicker
#

what do you get if you run :set errorbells?

#

include the question mark please

drowsy lava
#

alright

#

it returns

#

noerrorbells

#

here is the terminal

#

and it's output

eternal flicker
#

right, can you set visualbell and set t_vb= in your config?

drowsy lava
#

alright

#

t_vb=

#

it's equal to what though

eternal flicker
#

run :help t_vb

drowsy lava
#

alright

#

so this a true false thing?

#

I set it equal to false then?

eternal flicker
#

nop, you should set it to be empty, that's why the = is hanging

drowsy lava
#

ah gotcha

#

so it'll work now?

#

yes it works

#

the screen flashes red tho

#

that's fine lol

#

thanks

drowsy lava
#

the first one is WSL and the 2nd is in windows

#

I'm not sure why the coloration is different though

eternal flicker
#

the first one looks more correct

drowsy lava
#

yes it does

#

not sure what the issue is

#

do you know what it is?

eternal flicker
#

@drowsy lava looks like something to do with the background, since the other colors look correct

#

try also setting t_ut empty? set t_ut=

lone linden
#

any in depth guides to deployment of django apps

buoyant canopy
inland ginkgo
#

how could i go 1 update back

#

like pycharm new update is assss

quaint saffron
#

@inland ginkgo try resetting your project interpreter

#

The version it's pointing to isn't on your pc

inland ginkgo
#

i mean the code works but when i try to do a change

#

i get this error

#

@quaint saffron

#

like i have the bot online now

#

but when i go to do a change the bot goes offline

wooden ibex
#

Brunckek, Docker

dull otter
#

anyone here with hyper terminal error experience? im getting an error about updating plugins on program startup so none of the plugins i added are working

#

@ me plz

faint comet
#

any editor recommendations?

drowsy lava
#

@eternal flicker it didn't work

eternal flicker
#

what does running :version give you?

drowsy lava
#

I have no idea what any of this is

eternal flicker
#

what version of Windows Terminal are you using?

drowsy lava
#

the latest one

#

e

eternal flicker
drowsy lava
#

alright

#

that broke it

#

i'm trying a fix hold up

#

Nope it's still the wrong colors

#

I would write in WSL but in WSL a lot of my projects don't work

eternal flicker
#

you said that the right one is Windows?

drowsy lava
#

wait no left

#

sorry

#

Left is windows right is WSL

eternal flicker
#

I have no idea what sort of shell is the Windows Terminal, but can you check the environment variable TERM? It would be retrieved using echo $TERM on Unix systems, maybe set TERM on windows?

drowsy lava
#

it's powershell

eternal flicker
#
$Env:TERM
drowsy lava
#

nothing shows up

eternal flicker
#

right, now try setting the environment variable to xterm-256color:

$Env:TERM = "xterm-256color"
drowsy lava
#

in the terminal right?

#

no need to do it inside of vim?

#

I mean .vimrc

eternal flicker
#

nono, this are powershell commands

drowsy lava
#

ah gotcha

#

Yeah I did it in PS

#

yeah I entered in those commands

eternal flicker
#

now if you run $Env:TERM again xterm-256color should show up, then check if the issue is fixed (cross your fingers!)

drowsy lava
#

nope

#

nothing showed up

#

I did both and nothing happened

eternal flicker
#

did you create a new terminal?

drowsy lava
#

oh no

#

hold on

#

still the same thing

eternal flicker
#

I'm stumped

drowsy lava
#

hmmmm maybe just find a way to change the bg color?

#

Really I just need it to be gray

eternal flicker
#

right, after sourcing your colorscheme, try placing this:

highlight Normal ctermfg=black ctermbg=red
drowsy lava
#

alright

#

adding in set background=dark made everything this way

#

so maybe if I removed that line?

eternal flicker
#

hmm, does removing that line change anything?

drowsy lava
#

removing it

#

gave the first image

eternal flicker
#

removing it gave the image with all the white?

drowsy lava
#

yes

eternal flicker
#

but setting it doesn't seem to change anything either

drowsy lava
#

hmmm

#

those previous settings

#

with the echos

#

were just to set the color?

eternal flicker
drowsy lava
#

hmm

#

i'm reading through this rn

#

I changed the colors but nothing happened

#

it's the same

#

what's with the bg colors

#

look at the 1st comment

eternal flicker
#

I wonder if setting your Windows Terminal background works

drowsy lava
#

let me try that

#

hold on

#

the color change affects power shell

#

but it doesn't affect Windows Terminal

#

the color change takes place in powershell

#

INTERESTING

#

it works with cmd too

#

but the text is too small and I can't go into full screen

#

Top left cmd, right most powershell, bottom is Windows Terminal

#

and this is .vimrc in windows terminal with cmd as the current active shell

eternal flicker
drowsy lava
#

IKR

#

IT's so interesting

#

there is another version called windows terminal

#

I was using windows terminal preview

#

let me try it on that

#

windows terminal has no changes either

#

now new error

#

my PS is broken

#

the text became yellow

#

an interesting property is that if i enter vim and edit a file

#

any file the text from ls or pwd shows up

#

but if I do pwd again nothing shows and I have to repeat the process

#

if I use powershell through cmd it works fine

#

using another ps1 profile fixes it

drowsy lava
#

@eternal flicker sorry for the ping but I have a new issue I can't copy and paste in vim

eternal flicker
#

do you mean you can't copy and paste within vim, or you can't copy and paste from the system clipboard to vim and vice versa?

#

to access the system clipboard in vim,you have to use the + register, so "+p will paste whatever you have in your system clipboard

drowsy lava
#

I can't do copy and paste

#

outside of vim

#

like from another file to vim

eternal flicker
#

to access the system clipboard in vim,you have to use the + register, so "+p will paste whatever you have in your system clipboard

drowsy lava
#

oh

#

control p used to work

#

where do I need to write it in though?

#

like in a terminal

eternal flicker
#

in normal mode

drowsy lava
#

the vim terminal the one you access through :

#

hmm

#

that is intersting

eternal flicker
#

what is?

drowsy lava
#

That I have to paste like that

#

is there a way I can alias "+p?

eternal flicker
#

yep

#

I use this:

" -- Pasting --
" Yank into + buffer
nmap <leader>y "+y
vmap <leader>y "+y
nmap <leader>Y "+Y
vmap <leader>Y "+Y
" Paste from + buffer
nmap <leader>p "+p
vmap <leader>p "+p
nmap <leader>P "+P
vmap <leader>P "+P
drowsy lava
#

so where do I past this in?

#

.vimrc?

eternal flicker
#

yep

drowsy lava
#

could you tell me like

eternal flicker
#

your leader key is \ by default

drowsy lava
#

what's leader key

eternal flicker
#

your leader key is \ by default

drowsy lava
#

most of the settings in my .vimrc is copied from a yt vid

#

I don't really know what most of them does

eternal flicker
#

it's basically a free key for you to sorta "namespace" your bindings

drowsy lava
#

oh

#

in this " -- Pasting -- " Yank into + buffer nmap <leader>y "+y vmap <leader>y "+y nmap <leader>Y "+Y vmap <leader>Y "+Y " Paste from + buffer nmap <leader>p "+p vmap <leader>p "+p nmap <leader>P "+P vmap <leader>P "+P

#

how do you know which key is which

#

could you give an example of how you use this?

#

I don't really understand this

eternal flicker
drowsy lava
#

so this works with control v right?

eternal flicker
#

nop, what this does is make \p act as "+p while in normal and visual mode

#

you could rebind Ctrl+V to what you want, but Ctrl+V is already bound by default in vim to visual block select

#

which is pretty useful, so rebinding that is discouraged

drowsy lava
#

ah gotcha

#

so \p does the same then?

eternal flicker
#

same as?

#

with the above bindings, \p does the same as "+p

#

\P does the same as "+P

drowsy lava
#

so \p = +p then

eternal flicker
#

"+p, note the " character

#

" let's you select a register, so "+p means select (") the system clipboard register (+), then paste (p)

drowsy lava
#

ahhh

#

got it got it

#

ah

#

your settings work just nice

#

thanks

tribal shale
#

Anyone have any good courses,video recommendations on Jira-Zephyr implementation
I have checked out few github code but couldn't understand how to make it work so looking to do some research/learning on how implementation is done

analog ore
sand thistle
#

hello, im following this DO tutorial

#

and I'm a bit confused in the server block portion
specifically this section

#
        listen 80;
        listen [::]:80;

        root /var/www/example.com/html;
        index index.html index.htm index.nginx-debian.html;

        server_name example.com www.example.com;

        location / {
                try_files $uri $uri/ =404;
        }
}```
#

so for this line server_name example.com www.example.com;

#

the actual website im trying to host on there has its DNS (?) set up as such

#

example.example.com

#

does that make a difference?
should I do server_name example.com example.example.com

buoyant canopy
#

only do the domain you want nginx to serve from for these rules

#

if you don't want to serve from example.com, don't include it

sand thistle
#

so everything after server_name

#

will be what nginx serves

#

@buoyant canopy

buoyant canopy
#

it's a list

#

yes

sand thistle
#

thx

sand thistle
#

hmm now im having a hard time making sure it's actually displaying the appropriate html file

#

it's not serving the one it should be

#

just the default nginx one

#

i have followed all steps inside of this tutorial

#

I am not sure why this isn't working, is there something that may need to be enabled in order to serve the appropriate html

#

not sure how I'd go about debugging this, everything seems to be in order, ran through the steps multiple times

#

it's serving up the default nginx page

severe pivot
#

Hey guys

#

has anyone used SPYDER Ide?

#

I want to toggle word wrap

#

can't find the option

#

it's driving me insane πŸ˜„

sly flare
#

Hey, I have a final question about Git and Github, just to make sure I "barely" understand how does these things work.
Let's say, we're making a game, and I have to create an options tab, on the main menu page and my workmate have to create an about tab on the main menu page. However, he finished earlier, and started a pull request, then a few minutes later, I finished as well.
Then, the project lead accepted the about page, but that changed a few things in a file, and I had to resolve a merge conflict.
So my question is, if the project lead had accepted my work earlier, would my workmate have had to go through the same process?

tawdry needle
#

possibly

#

very likely

#

e.g. let's say line 23 of main.c says int x; int y; in your friend's repo, and it says int x, y; in your repo -- you will always have a merge conflict no matter who goes first

sly flare
#

So that's the basic workflow? I push my solution, he passes his solution, we review and accept if there's no conflict?

tawdry needle
#

that is one way to do it

#

alternatively he pushes, you wait for the maintainer to accept, then you pull and resolve the merge conflict locally, then push and make your own PR

sly flare
#

Okay, I think I understand it now! Thanks! πŸ˜„

heavy knot
#

why does anaconda prompt not give me an error when running python manage.py runserver

#

but i get an error when i try to run it in any other powershell or cmd

#

i get this error ImportError: DLL load failed: The specified module could not be found.

sly flare
#

Django is pre-included in Anaconda, I reckon.

heavy knot
#

So i need to use the anaconda prompt when i want to develop a django app. But i want to use windows powershell or cmd emulator.

tawdry needle
#

you can set up anaconda/conda to work outside the anaconda prompt

#

you should also create a conda environment for your project

#

don't use the base environment

heavy knot
#

i did that

#

pipenv shell

#

the problem is

#

i get this error

#

when i run it in windows powershell

tawdry needle
#

i cant look at pastebin at work

#

pipenv and conda are completely different tools

#

pick one

sly flare
#

@heavy knot
If you have pipenv installed just simply initialise a pipenv env in a directory, install django and create a project, then if you use pipenv shell, you should be able to run it without any problems.

#

in CMD.

heavy knot
#

how do i init a pipenv env in a dir

sly flare
#

pipenv three
after cd

heavy knot
#

o

#

that's what i did

sly flare
#

then pipenv install django

heavy knot
#

then installed django

#

yes

#

and then pipenv shell

#

then django-admin startproject proj .

#

then python manage.py runserver

#

output:

#

one big fat ugly error

sly flare
#

Do you use windows?

heavy knot
#

yes

sly flare
#

then, check with the command "dir" if you're in the right directory.

#

however, you should be.. πŸ˜„

heavy knot
#

i am

#

still get the error

sly flare
#

Strange, check you Enviroment variables there has to be something...

heavy knot
#

which one

#

system or..

#

user variables

sly flare
#

It depends, if you installed python only on your user's profile then user variables.

heavy knot
#

should i check the variable

#

path

#

the value of path is

#

i see a list of paths in path

dull otter
#

is there a tutorial somewhere for creating an init.py file and requirements file?

heavy knot
#

if u have a venv

#

u can pip freeze > requirements.txt

tawdry needle
#

There's something in the docs that explains init and modules/packages. Dont have a link now though

#

Requirements is easy, just a list of arguments to pip install

shadow crow
#
class X:
    fn: Callable[[], int]

    def __init__(self, fn: Callable[[], int]):
        self.fn = fn

This pisses mypy off because

Cannot assign to a method
Attribute function "fn" with type "Callable[[], int]" does not accept self argument
Is there some workaround?

tawny temple
#

Interesting. Does it think you're trying to assign a bound function since you're using an attribute with self?

#

Have you tried X.fn = fn?

#

I don't know if you can even access X yet actually

#

self.__class__ or whatever

tawdry needle
#

but self.__class__.fn is different from self.fn

#

the former assigns to the entire class, the latter to the instance

#
import attr

@attr.s
class X:
    fn: Callable[[], int] = attr.ib()

πŸ™ƒ mypy accepts this

#

but honestly "cannot assign to a method" is kind of a meaningless non-error

#

strange that mypy has this behavior

#

ahhh do you have to mark it as staticmethod?

#

evidently staticmethod is not the same as Callable[[], int]

#
from typing import Callable

class X:
    fn: Callable[[], int]

    def __init__(self, fn: Callable[[], int]):
        self.fn = staticmethod(fn)
#

it definitely is doing some kind of uncouth over-eager inference

#
from typing import Callable

class X:
    fn: Callable[[X], int]

    def __init__(self, fn: Callable[[X], int]):
        self.fn = fn
Incompatible types in assignment (expression has type "Callable[[X], int]", variable has type "Callable[[], int]")
twin hull
#

Do you know why on some repos PR aren't merged directly but instead commited by the owner?

#

Could it be just to avoid the merging commit?

tawdry needle
#

The owner probably just prefers doing the merges on their computer instead of on GH

#

It would still create a merge commit

keen oak
#

hi i am trying to make a bot with selenenium and im stuck with an error saying
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="meetingSimpleContainer"]/div[2]/div[2]/input"}

#

ive searched about it and found an article but i am pretty new to programming and have no knowledge of html, css so i dunno what frames are and so on

wooden ibex
#

Kraktus, some people prefer doing it locally, it's commonly not done in business setting because most businesses require approval from others, therefore, you have to do it via web interface

sage perch
#

@keen oak try with an id, it might work

keen oak
#

@sage perch i did but im not sure what the id for the input space i want is and how to find it

sage perch
#

Does it have text in it? @keen oak

#

On the input thing

#

Smth saying what it does or what to put there

keen oak
sage perch
#

I think driver.find_element_by_text('Your full name').send_keys('your input')

#

That might work

keen oak
#

hol up ima try it

sage perch
#

Ok

keen oak
#

@sage perch for some reason it says AttributeError: 'WebDriver' object has no attribute 'find_element_by_text'

sage perch
#

Idk

#

Are you using chromedriver?

#

@keen oak

keen oak
#

yeah

sage perch
#

Try link text

#

Or partial link text

keen oak
#

okey gonna give it a go

#

didnt work my guess is that the box i want to access is on a different frame or because to get to it the page reloads it searches on the elements of the previous page

sage perch
#

Idk how to fix that

sly flare
#

Hey! I have a question about git-github operations. Let’s say I’ve finished my work on my branch, and after that I pull the new commits from the remote repo, then I resolve the merge conflicts if there are, then what’s the established custom? Should I create a pull a request to let other people review my code or just simply push into the master branch?

keen oak
#

from what i understand this is my problem but i dont get the article that much is there anybody that can explain it to me ????

#

thanks for the help in advance

lone linden
#

have you tried waiting for the element to show up

#

river.switchTo().frame(0); // use this if it's in frame and you don't know how to locate it WebElement input = (new WebDriverWait(driver, 15)).until(ExpectedConditions.presenceOfElementLocated(By.id("qt_invoices_text1"))); like it says

keen oak
#

@lone linden i dunno know how to do that cause my code format is kinda different you can understand what i mean if you check the github link that i posted a bit ago

lone linden
#

im still at work, i'll give it a look later if you still havne't found the source of your problems

keen oak
#

thanks i have to go now too but tag me and ill answer anytime thanks for the help!!!

heavy knot
#

anyone familiar with sphinx? I can't seem to get autodoc to work

Welcome to dpyutils-crazygmr101's documentation!
================================================

.. automodule:: dpyutils


.. toctree::
   :maxdepth: 2
   :caption: Contents:



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
import typing
from discord.ext import commands
import discord

class Example:
    """
    boop
    """
    pass
sudden lagoon
#

BACKGROUND
I'm working with enums and today I used the enum module to do this. My environment is the latest version of pycharm (community edition) with python 3.7. The program is working as expected but I cannot get rid of the yellow underline notification that pycharm is displaying. I have listed this issue in this channel due to it being a tools related question (tool being pycharm).

ISSUE
The issue here is the notification message that pycharm displays which can be seen here. It says...

Expected type 'Iterable' (matched generic type 'Iterable[_T]'), got 'Type[Operation]' instead

This notification is in reference to the following line of code specifically the choices=list(Operation) piece...

parser.add_argument('--action', type=Operation, choices=list(Operation))

Is there something that I have yet to fix? How do I resolve this notification message?

CODE
The code can be seen from here along with the pycharm notification message. I'll include the code below for convenience...

import argparse
import enum

class Operation(enum.Enum):
    CREATE = 'create'
    DELETE = 'delete'
    def __str__(self):
        return self.value

def parse_args() -> argparse.Namespace:
    parser = argparse.ArgumentParser()
    parser.add_argument('--action', type=Operation, choices=list(Operation))
    return parser.parse_args()

def main():
    args = parse_args()
    if args.action == Operation.CREATE:
        print('{}'.format('it is create'))
    if args.action == Operation.DELETE:
        print('{}'.format('it is delete'))

if __name__ == '__main__':
    main()
tawny temple
#

It's likely a PyCharm bug

#

I don't think it's worth trying to do anything about some silly squiggly line.

#

Assigning the type to a variable and using a type annotation for the variable will probably work.

sudden lagoon
#

Would you be so kind to elaborate a bit more on how to implement your suggestion? Very new here.

#

thank you for your time

tawny temple
#

It was more said for the sake of completeness than an actual suggestion.

#

It's not worth doing

sudden lagoon
#

Ah, I follow you. I will proceed as my implementation is correct then. Thanks again.

tawny temple
#

I don't even know the right type annotation

#

I meant something like ```py
import typing

FixedOperation: typing.Iterable[????] = Operation

#

But yes, nothing to worry about. Your code is correct and PyCharm is wrong.

heavy knot
#

yeah apparently pycharm unlines some weird things

#

like apparently in django it thinks that calling .object on one of ur instances is invalid

rough marlin
#

@pastel knoll this might be the channel you want for IDE related questions btw

#

sorry for sort of ignoring you earlier

#

My opinion is that pycharm is best, but Visual Studio might be more generally useful.

#

Sublime is nice and minimal, but it isn't an IDE out of the box, just a text editor.

mystic flint
#

does anyone know heroku / boto and can tell me WTF is going on?

#

i see the code example to get config values into the code, but i have no idea where to get the S3 key / S3 secret??

tawdry needle
#

@mystic flint you need to get those from your AWS account

mystic flint
#

i thought i was supposed to use this boto lib to get the envir vars. it was just an example...

hollow plover
#

@mystic flint Please refrain from using profanity similar to that

#

Even though it's directed at yourself, it can be offensive to some.

lethal flax
#

Anyone with some poetry experience here? I'm hosting internally made artifacts (with poetry build) on a server behind a twistd webserver, but when I add one as a dependency I get a weird error in poetry

#

error: package directory 'gp_util\virtualenv\gp-util-MoV2fGBn-py3\8\Lib\site-packages' does not exist

(gp_util is the name of the internal dependency)

#

note how it somehow has "split" the python version in the env path?

#

or is it trying to install it from a local installation rather than the package source?

crimson stump
#

Anyone here have experience with Jenkins and robot roles?

tawdry needle
#

@lethal flax can you clarify your situation a bit

#

file structure, which venvs are active at what time, etc

lethal flax
#

So on my CI server I build that gp_util project using poetry build and then copy it over automatically to my package index directory

#

the venvs are managed entirely by poetry

#

I'm not sure where that env above in the error comes from ... does poetry create temporary virtual environments for packages that it downloads?

tawdry needle
#

poetry creates virtual environments for projects... if you are running poetry install without a venv active, it will create a venv for you and install into that venv

#

im not sure how it works on the poetry build side

lethal flax
#

how I set up this project (the one that has the dependency) is I first made a poetry config without that in-house dependency, made sure it would run, then see it (obviously) fails a bunch of unit tests, and then I did poetry add and got said error

#

so maybe there's something wrong with how my artifact is made I dunno

#

weird thing is I played around with this last week to explore poetry as an option and did get it working I think, but I since changed a lot of things (including the python version, since I discovered I was using a different version for dev and the CI)

tawdry needle
#

are they on 2 different machines?

#

what are you passing to poetry add?

#

and where does that error arise? upon poetry add?

lethal flax
#

poetry add gp-util is the command

#

which fails

#

with [EnvCommandError]

#
Command ['XXX\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\gp-data-model-0BPugCMN-py3.8\\Scripts\\pip.exe', 'install', '--no-deps', '--trusted-host', 'ci', '--index-url', 'http://ci/repository', '--extra-index-url', 'https://pypi.org/simple/', 'gp-util==0.1.0.dev0'] errored with the following return code 1, and output:
Looking in indexes: http://ci/repository, https://pypi.org/simple/
Collecting gp-util==0.1.0.dev0
  Downloading http://ci/repository/gp-util/gp_util-0.1.0.dev0.tar.gz (4.0 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: 'XXX\appdata\local\pypoetry\cache\virtualenvs\gp-data-model-0bpugcmn-py3.8\scripts\python.exe' 'XXX\appdata\local\pypoetry\cache\virtualenvs\gp-data-model-0bpugcmn-py3.8\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'XXX\AppData\Local\Temp\tmpk66l4567'
       cwd: XXX\AppData\Local\Temp\pip-install-ch0nd8ek\gp-util
  Complete output (7 lines):
  running egg_info
  creating gp_util.egg-info
  writing gp_util.egg-info\PKG-INFO
  writing dependency_links to gp_util.egg-info\dependency_links.txt
  writing top-level names to gp_util.egg-info\top_level.txt
  writing manifest file 'gp_util.egg-info\SOURCES.txt'
  error: package directory 'gp_util\virtualenv\gp-util-MoV2fGBn-py3\8\Lib\site-packages' does not exist
tawdry needle
#

what happens if you manually create a venv, poetry install in it, then poetry add

lethal flax
#

(replaced some paths with XXX)

#

I've never manually managed venvs

tawdry needle
#

gp_util\virtualenv\gp-util-MoV2fGBn-py3\8\Lib\site-packages

#

this is off

lethal flax
#

yeah

#

it's odd

tawdry needle
#

this looks like you somehow inserted venv stuff into the gp_util source

lethal flax
#

I'll take a look at the tarball

tawdry needle
#

yeah seems like the best thing

#

also verify that the actual files in your gp-util repo are correct

lethal flax
#

indeed!

#

it seems to contain a venv in the tarball

#

in my CI I found that it's easier to debug & manage if I let it create the venvs inside the project

#

also makes it possible to remove them prior to build if required etc

#

but apparently poetry build also wraps it up along in the tarball - pipenv didnt do that iirc

#

I'll see if I can exclude it from the build - or delete it or something

#

thanks for the tip

#

It's always something profoundly stupid like this isn't it

tawdry needle
#

what do you mean "inside the project"

#

it sounds like you've done something wrong with your file structure @lethal flax

#

the project gp-util should not also be cotermnious with the package gp_util

lethal flax
#

I found it. The CI is creating the venv in the wrong directory. Poetry quite reasonably thinks it's part of the source code

#

Yeah that's another area where I'm confused, I don't quite understand the distinction

tawdry needle
#

i don't blame you, the names are bad

#

a module is effectively a namespace, 1 module per .py file

#

a package is a module that contains other modules, physically a package is a directory with a __init__.py file and 0 or more other .py files

#

a project or distribution is consists of least 1 module and/or package + supporting files and metadata such as pyproject.toml or the older setup.py

lethal flax
#

All my projects contain exactly one package

tawdry needle
#

yep. most do

lethal flax
#

but I'm supposed to use - in one and _ in the other?

tawdry needle
#

no, i just prefer it like that

#

obviously - cannot be in a package/module name, being invalid as a python variable name

lethal flax
#

yes hence the _ everywhere

#

but it's perhaps a good idea to rename my projects then to use -

tawdry needle
#

meh

#

- is more "unix-ey"

#

so i like it

lethal flax
#

yeah I get it, I'll consider it for sure

tawdry needle
#

it's easier to type and less visually intrusive. but that's personal preference and not at all convention

#
gp-util/  
  src/
    gp_util/
      __init__.py
      other_module.py
  tests/
    test_gp_util.py
  pyproject.toml
  README.md

this is a somewhat typical "modern" but simple project setup

#

there are a handful of advantages to keeping the package out of the top level of the project, hidden inside src

lethal flax
#

the src subdirectory is possible?

tawdry needle
#

yes

#

i often do src/python actually

#
[tool.poetry]
packages = [
    { include = "gp_util", from = "src/" },
]
#

its not just possible, imo its preferred

lethal flax
#

Allright I will consider it in my overhaul once I get pipenv factored out

#

Thanks for the tips

hot path
#

does anyone in here have experience with docker?

lone linden
#

you'll have more luck if you simply ask your question :p

gusty lance
#

Is it possible to change local git config [--global] user.name on mac?

tawdry needle
#

that command should do it

#

i think git on mac recognizes ~/.gitconfig

gusty lance
#

I ran that command but shows no output

#

~/.gitconfig is empty

tawdry needle
#

git config --global user.name nowater

#

that will set it

gusty lance
#

@tawdry needle πŸ‘πŸ’―

tawdry needle
#

@jade birch

https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append

I’m currently looking at this API and there’s a required parameter called β€œrange”. It's described as "The A1 notation of a range to search for a logical table of data. Values are appended after the last row of the table." I honestly don’t quite understand what it’s purpose is or what it effects.
if you set range to A1:Q15 it will append the data in row 16. there are some usage examples in the docs
https://developers.google.com/sheets/api/samples/writing#append_values
https://developers.google.com/sheets/api/guides/values#appending_values

jade birch
#

@tawdry needle If row 16 is filled, will it do row 17 then?

tawdry needle
#

that i do not know

#

it might shove everything downwards

#

hopefully the docs clarify

jade birch
#

ok

#

ty

#

@tawdry needle I think I figured it out as much as I'll need to

#

thank you

sage perch
#

I'm trynna make a password manager that automatically records passwords (I normally use long, hard to guess passwords) for certain sites and saves it to a text or excel file on the desktop

If anyone can help me with that pls @ me

#

I couldn't find anything on stack overflow

#

Or youtube

weary ore
#

where do dockerfile commands install the libraries?

lone linden
#

basically to your disc

median reef
#

sir i have some doubts ,i had watched your python web automation video,i tried to automate google meet,everything is working well except when i join the meet with the join id,i switch to the child node correctly and interacted with evry element,algood,except the alert box on the chld window can not be closed,it says no such alert,the alert requests for cam mic permission whcih in want to dismiss,Stuck for two days? used wait methods too still no luck?any suggestion?

true vapor
#

I have two git repos, I'll call them stuff-repo and boilerplate-repo. I want to move stuff-repo over to boilerplate-repo, keeping the commit history, but I also need to keep whatever currently exists in boilerplate-repo (although not the commit history)

#

do I just set boilerplate to be the new remote, then try and merge? Will that just work

warm pollen
#

That could actually work yeah, assuming you won't run in any conflict because the two root folders are named the same way

keen oak
#

hi does anybody know of a way to automate my python scripts with task scheduler the way i found on google doesn't work for me the python terminal just opens and instantly closes

lone linden
#

cron perhaps?

#

unsure what you have tried so far

gusty willow
#

yeah ... cron is probably the most simple ... although ... in a linux context, i tend to default to systemd-timers now

keen oak
#

neither work

lone linden
#

any advvantages over cron?

keen oak
#

what is cron?

lone linden
#

if you're on windows, doesn't matter

#

basically a task scheduler on linux

keen oak
#

ahhh yeah im on windows

gusty willow
#

@lone linden has more human readable notations (e.g. 1h vs the cron notation) and also they can be templated with normal systemd templates

lone linden
#

oh cool, i'll look into it

gusty willow
lone linden
#

archwiki πŸ’Œ

gusty willow
#

but yeah ... i haven't touched windows in ... jeeze, maybe 5 years

lone linden
#

i switched after college, never looking back

#

at least not for dev work

gusty willow
#

if I took a job that made me use windows ... I would be sure to install WSL2 and launch it via the newish windows terminal from then on

#

so basically ... use linux lol

#

but i would rather an honest to goodness linux distro (although, Fedora is my jam)

harsh panther
#

Hii I wnt to get started with devops I have one repo of which I am only contributor can I use it for free

#

My repo is private

gusty willow
#

ah, that might be a little different ... Azure is free to an extent ... so it will depend exactly what it is you are trying to do

harsh panther
#

I have one small project

gusty willow
#

you might be better off with a TravisCI or CircleCI

#

right ... the project size doesn't matter in Azure ... more what parts of Azure you are going to utilize

harsh panther
#

I am searching for free Travis is not free

#

I only want to check my code when I deploy

#

I mean push

#

And deploy

gusty willow
#

Travis IS free ... but maybe no the plugged in version that exists on GitHub

#

personally ... I prefer GitLab myself

harsh panther
#

Hmm I am using GitHub

#

So what u recommend

#

I am student of class12th so can't spend much

#

I am planning to spending on hosting

#

So I am searching for free service

#

Which can test my code and deploy

gusty willow
#

deploy to what exactly? there are lots of things that you can deploy to that don't cost anything (heroku / netlify / etc...)

harsh panther
#

Aws

gusty willow
#

why not use AWS native things then?

harsh panther
#

I haven't buyied hosting yet

gusty willow
#

Ok, then don't ... use heroku or netlify

#

don't overcomplicate things until you need to πŸ˜„

topaz aspen
#

whats the command to create a terminal with a horizontal split in vs code

simple trellis
#

make a service probably

floral edge
#

@heavy knot how are you running it? what situations makes it go down? usually you run your app using a process manager like systemd that starts and restarts the process when for some reason it stops. yet, this is usually not enough and you need to perform some kind of health check.

floral edge
#

yeah, start with a simple systemd service if you want. do you have logs? if yes, look in your logs if there are any exceptions or fatal logs or sth, if not then add some.

#

right, this is similar to when you logout in your pc, your bot is no longer running at that point because any processes you've started would be stopped before logging out.

#

yeah, just running it as a service should do

#

ah sorry I don't have any but google should give you some links

#

you just want to lookup how to make a systemd service

#

yeah, there are other process managers out there

#

I don't usually use them tho so I don't know of any other than systemd

#

sure, you could also ask here :)

harsh panther
#

@gusty willow which heroku I use I meant there are many in GitHub marketplace

#

I wnt to test and deploy on push

#

Can azure pipeline help

#

Is it free

#

And what is parallel job?

gusty willow
#

Why are you so focused on azure?

#

@gusty willow which heroku I use I meant there are many in GitHub marketplace
@harsh panther I would say just the general "deploy to heroku"

#

Also, have another action to run your tests

harsh panther
#

I wnt to get notified if my build fail

#

On github

#

I wnt to test azure

#

My all friends use

#

That's y I am so focusedπŸ˜…

gusty willow
#

Ok, well, they tend to be proud of the devops stuff, so is unlikely is going to be free

#

Why not ask your friends what they are doing

harsh panther
#

They will not tell

#

If they use it for free

#

And what is parallel build

#

In azure

gusty willow
#

Parallel builds are the same everywhere. That means that tests and deployment or whatever other steps you have will run in parallel (at the same time), not serially (one after the other)

#

They will not tell
@harsh panther not very good friends lol

harsh panther
#

Yup u can say

#

So how many push I can do in one day

#

It allow 30h

#

For private repo

#

Each month

gusty willow
#

Depends on your tests generally

harsh panther
#

Hmmm

gusty willow
#

But at least you have an optimization target

harsh panther
#

10 push a day???

#

If my build fail and if I try to push again

#

It will be count 2 or 1

gusty willow
#

Again, depends on your process. If your tests take an hour to run (unlikely) then you get a whole lot less

harsh panther
#

I don't have a huge code

gusty willow
#

If they fail and you push again, it's two

#

It's all time based

harsh panther
#

Ooo time based

#

What u recommend

#

What should I try

gusty willow
#

Not using azure lol

harsh panther
#

I wnt to test and deploy if azure then other?

#

My repo is private

gusty willow
#

What is your app? Why is it private

harsh panther
#

I have code for discord bot

#

Buddy?

gusty willow
#

Sounds like it could probably be a serverless function and those tend to be very cheap

#

So yeah, heroku would be plenty

harsh panther
#

Which heroku should I use

#

I mean which one

#

From these

gusty willow
#

The "deploy to heroku"

harsh panther
#

It's for node js?

#

Sorry if I am irritating I am new to these stuff

#

So sorry

gusty willow
#

So here is what I do when I don't know the answer to something: I try it... Lol

#

So rather than me doing all of this for you, give it a go and I'll try to help if I can

harsh panther
#

Will this work?

heavy knot
#

lol im not so trusting of these hosting services

gusty willow
#

Semaphores is ok, I've not used it myself

#

I like heroku, it's legit

#

I'm a GCP person myself though

harsh panther
#

Hmmm GCP is free for private repo?

gusty willow
#

No

heavy knot
#

glich layout kinda seemed sus to me imo

gusty willow
#

There is very little free about gcp

heavy knot
#

so im sticking with aws

gusty willow
#

No one ever got fired for choosing AWS lol

harsh panther
#

Hmmm

heavy knot
#

glitch kinda made me scared

harsh panther
#

What is the condition

#

2 hours a day?

#

Every day I can test for 120 min?

heavy knot
#

i think heroku is 30 min if using free

#

then it goes to sleep

harsh panther
#

Hmm

heavy knot
#

i guess the free tier is fine if u just want to test things out

#

bro

#

chill

#

thats right delete ur msg

#

too scared about being banned

eternal flicker
#

they're already banned

heavy knot
#

oh lol

harsh panther
#

1x CI/CD job at a time

What this means☝️

#

I am thinking of giving a shot to simaphore

harsh panther
#

How can I run CI/CD on my local machine?

harsh panther
#

here is my pipeline

#

[warning]The 'junit_family' default value will change to 'xunit2' in pytest 6.0

#

getting this error

heavy knot
#

Hello everyone

#

Can you tell me why doesn't output show in terminal in visual studio code when I select Power Shell?

#

pls tell

delicate tinsel
#

hmmm

#

as a Linux user, I can't be very sure

#

let me check

#

@heavy knot is it stuck in something along the lines "Starting powershell..."?

heavy knot
#

no

#

Like I'll show you

#

See no output in terminal

delicate tinsel
#

are you running the .py file?

#

(btw print goes with lowercase)

heavy knot
#

Sorry

#

Me a noob

delicate tinsel
#

now to run programs in Python you need the interpreter to know you want to run it and the name of the program, therefore the command you want to execute down there is
python hello.py

heavy knot
#

Where do I type this?

#

Like this?

delicate tinsel
#

not inside the program, where the powershell thingy is

#

abhi_\Desktop\Python

heavy knot
#

Wait

#

I can't type thare

#

*there

delicate tinsel
#

hm

#

it's curious

#

i mean, it's basic really, have you clicked on the term yet?

heavy knot
#

Yes I tried

#

I'll just reopen

#

DOne

delicate tinsel
#

maybe try using cmd instead of powershell... it's better

heavy knot
#

Should it work now?

delicate tinsel
#

2 things

#
  1. remove that python hello.py from the hello.py program, just leave the print("Hello World")
#
  1. the file is not saved for which to a computer nothing was done
#

that's why you're getting no output

heavy knot
#

IT's still showing nothing

delicate tinsel
#

now do the same you did in last picture, but you see that white dot on the side of hello.py?

#

hit CTRL + S and that'll save the file

heavy knot
#

ok

#

I have saved it

#

Still same problem

delicate tinsel
#

u sure?

#

white dot is still there

heavy knot
#

OK

#

DOne now

#

Whever I type enter it shows unsaved

#

IDk why

delicate tinsel
#

it's adding lines, therefore making changes

#

but don't press enter there anymore, go to the powershell term and type what you typed before

heavy knot
#

||python hello.py||

#

THis one

delicate tinsel
#

yes

heavy knot
#

It worked

#

Thanks

delicate tinsel
#

πŸ‘

heavy knot
#

Thanks you a human right?

#

@delicate tinsel now I have another problem

#

When I type any other thing it still shows Hello world as ouput

timber atlas
#

you need to save your file or it will execute the same old file

#

as you can see at the top left "unsaved"...

heavy knot
#

@timber atlas you mean I need to save every file after execution

timber atlas
#

yeah

heavy knot
#

Ohk

timber atlas
#

or in vs code you can decide to save automatically the file

heavy knot
#

I am doing python now

timber atlas
#

yeah

heavy knot
#

or in vs code you can decide to save automatically rhe file
@timber atlas How do I do that

timber atlas
#

wait a sec

#

just go into the settings and change the first one "auto save"

heavy knot
#

Which option out of these

#

?

timber atlas
#

maybe after delay idk 2sec

heavy knot
#

You mean after dalay?

timber atlas
#

yes

heavy knot
#

ok

#

Thx

timber atlas
#

and I meant you don't need to save your file after each execution. You just need to save it if you made changes or it will execute the old version of the file

heavy knot
#

ok

#

SO it should work now right?

timber atlas
#

yeah

heavy knot
#

I am also using visual code but why isn't it showing that I am using it in discord

#

Like yours

timber atlas
#

i have an extension

#

in vs code

#

called discord presence

heavy knot
#

ok

timber atlas
#

and if you install it you'll have the same thing

heavy knot
#

Is there a link?

#

How to install?

timber atlas
#

just click on the four square icon on the left in vs code and search for "discord presence"

#

it's the first one of the list

heavy knot
#

Please send me picture I am unable to find

timber atlas
heavy knot
#

ok

#

Thx

heavy knot
#

how do i update an image in a docker container

heavy knot
#

@heavy knot Idk
I have jaut started learning python

#

lol apparently with docker u gotta make new container each time

#

i found that out a couple hrs ago and its kinda a hassle

ebon isle
#

hey all, is this the channel to ask questions for pyinstaller?

#

Google searched my question nvm.

umbral jay
#

what's the difference between python venv and docker? They look similar to me. Both are containers

heavy knot
#

i think docker is more closer to a vm than venv

#

cuz i think with docker u can specify ur os

#

but with venv u can only specify ur python version

covert kindle
#

Yes, docker is more like a vm. It creates a unique environment that you can install anything you want into it. After you stop it, all the data is destroyed, unless you specify it to persist.

That sounds like a negative, but it's actually a positive. In the Dockerfile, or docker-compose, you can specify exactly how the container should be built everytime. So you get a rock-solid environment that is pretty much portable. No more installing and configuring programs when you switch computers/servers/projects. Just run your dockerfile and you're done.

I use docker for managing my media setup, for django/redis/postgres development, or for some quick experimentation that I don't want on my actual system.

#

If you're a windows user like myself, it opens you to all the tools of linux, either for use or for learning.

Dockers is an amazing tool that is well worth your time. It may not seem useful at first, but once you start using it for the first time there's no going back. The possibilities are endless and everything is just so much simpler.

umbral jay
#

Yes, docker is more like a vm. It creates a unique environment that you can install anything you want into it. After you stop it, all the data is destroyed, unless you specify it to persist.

That sounds like a negative, but it's actually a positive. In the Dockerfile, or docker-compose, you can specify exactly how the container should be built everytime. So you get a rock-solid environment that is pretty much portable. No more installing and configuring programs when you switch computers/servers/projects. Just run your dockerfile and you're done.

I use docker for managing my media setup, for django/redis/postgres development, or for some quick experimentation that I don't want on my actual system.
@covert kindle can docker be used as some kind of virus isolation? If an app catches virus, it doesn't affect other parts of OS

blissful sluice
#

yes

#

with docker you do have to create a new container from your image to use it, but this takes a second or less usually

#

and it does provide some process isolation. I wouldn't say it's watertight, but it's better than nothing and avoids most of the problems

#

think of docker like a VM but without needing all of the OS parts since it can use your own host OS (if it supports it), this means like a VM, you can install programs and add files to your docker image that o my exist inside the docker image (which is great for deploying code - one docker image contains your entire app setup and code)

#

but since it doesn't contain a full OS, it doesn't ever have to "boot up" like a VM, or doesn't have to spend the extra RAM running another OS

#

so it's very very lightweight

#

there are downsides though: it's only available with supported kernels. no Mac in docker for example. Windows guest doesn't work well with Linux host, etc. etc.

#

but Linux on windows works much much better these days, and Linux on Mac works fine, so it's great for that

#

my usual workflow is to use pipenv for python, which lets me easily do local test, and then the docker build adds the pipfiles into the image to install deps, and then copies the code over

#

(saves having to freeze requirements.txt, and helps maintain correct versions)

heavy knot
#

Ok

#

Ik linux

#

Linux is more secure than windows

untold sail
#

windows is more stable

heavy knot
#

that heavily depends on the distro

blissful sluice
#

"linux is more secure" and "windows is more stable" are broad generalizations, they can be both, and there are always individual examples that buck the trend. I don't think it's a useful comparison to make unless you have a specific application in mind. For example high-security? you'd probably use a very specific security-focused linux with some specific software. Or if you had a particular program that is windows-only, then you have to use windows regardless of security or stability

#

pick the best option for the task you're trying to do. nobody's expecting you to follow a single OS like it's your favourite sports team

heavy knot
#

It’s not letting me run my code, this is the idle error:
IDLE's subprocess didn't make a connection. See the β€˜startup failure’ section of the IDLE Doc, online at β€˜website’

pallid salmon
#

Hey all I'm using ipython and doing a tutorial on matplotlib which makes charts. I make a chart and it's nice. But when I x out of it, I am stuck in my old prompt. I can't go to the next command prompt...I hit Ctrl Z and it kicks out of ipython...any tips on how to get the next command line without exiting ipython and having to go back in and re import matplotlib? Don't know if this belongs here

eager cedar
#

@untold sail KEKW "windows is more stable" KEKW

covert kindle
#

Every morning, the first thing I do on my computer is 20mins of touch typing practice. I've been doing it for a little over a year because it's fun and it warms me up.

Started learning vim yesterday and it's like learning touch typing all over again. So much fun! Not nearly as intimidating as people hype it to be. If you're thinking of learning it I definitely recommend checking it out. Just do vimtutor a couple times then browse around the docs for handy commands. I got a book on it that im starting tomorrow. Gonna see what fancy tricks are hidden away.

signal canyon
#

Hi Guys anyone could help me with Docker? I want to run a python file with a specific tensorflow version (1.14.0) in the same container?

lone linden
#

yea, sounds simple enough

#

any problems you're facing?

signal canyon
#

Please, find it in more detail on stackoverflow, thank you so much

lone linden
#

you already have got decent answers underneath

#

just use a tensorflow packaged container?

#

you've got correct answers underneath ?

signal canyon
#

Right I have just seen it,

#

I didn't use WORKDIR

#

Thank you @lone linden

lone linden
#

im glad you got it sorted

severe pivot
#

Hi guys

#

I have a question

#

I was not able to find any script tag referring to this source in the page source of index!

#

Is there any way to check for existence of a certain source?

faint frigate
#

how can i open a vsc in my second monitor

heavy knot
#

kk

signal canyon
#

CTRL+K

severe pivot
#

@severe pivot You can't beautiful soup only parses HTML. Are you using a browser to get the pages? if so check the library you're using to see if that function exists.
@heavy knot
Thanks I will search for it.

lone linden
#

afaik, bs4 can parse more then html

#

xml for example shouldn't be a problem

#

oh, but yea, that's a source, not exactly meant to be used with s4

tawdry needle
#

you'd have to parse the HTML to see which scripts it loads

#

fair warning: crawling, scraping, or otherwise automating access to most corporate websites is often a ToS violation

#

which we aren't allowed to discuss here as per server rules

lone linden
#

but still, it often is allowed, so straight up not being allowed to converse about it seems..off

tawdry needle
#

Mods and admins usually err on the side of caution with that one

#

It's to comply with discord tos and prevent the server from getting in trouble

lone linden
#

fair enough

rare eagle
#

I'm pretty limited on what I am able to install on my work computer until I prove some use cases... How is Spyder as an IDE? I've never seen it mentioned, but it auto installed with Anaconda

#

I'd prefer to limit any further installations as I'm prob pushing boundaries on a work computer as is with Anaconda (but it doesn't require admin privledges :))

#

Also should be mentioned I'm not exactly doing anything groundbreaking. I'm relatively new to Python and just want to do some simple(r) data analysi

crimson magnet
#

Does anyone have recommendations or articles on managing secrets in different environments?

#

I am reading it from an env file locally

#

but I use GCP and they offer a way to manage secrets online

blissful sluice
#

I use Vault (from Hashicorp) for secrets management in order to be somewhat cloud agnostic

#

so while running on GCP, it can use google's metadata server to fetch credentials; but locally, I need to provide a local role ID in env to fetch the credential

#

my vault client scripts actually tries to use the app role from env first, and then if it fails tries to fetch the data from metadata server

#

this app role ID for dev environments is manually maintained, but for someo f the other environments not running in the cloud (local build servers etc) the app role ID is deployed with ansible

#

oh, and terraform has a provider for vault, so you can have terraform generate secrets that go straight into vault, such as the password for cloud SQL instances, etc.

lucid latch
#

Has anyone ever gotten an error that says β€œclient_loop send disconnect broken pipe” during a ssh session?

vague lion
#

Yep. Usually after I left open a ssh session for WAY too long.

lucid latch
#

So how can I solve this ?

#

I am running something that requires me to let it run for a long time.

crimson magnet
#

@blissful sluice I will look into this solution, but to summerize. You developed a system for your app that depending what role id is provided it will know where to fetch the secrets?

vague lion
#

I don’t know of the best solution, but I use tmux on the machine im sshing into and run my long lived process there.

#

So you can disconnect from tmux and close the ssh session but the process lives on.

blissful sluice
#

so my apps will go fetch the secret that they need. for example, if it's a connection to postgres database, the app will talk with the vault server and fetch the password at runtime, using some vault credentials; which are either local dev environment Role ID/secret, or coming from Google metadata servers which serve as proof of origin

gusty willow
#

Vault is great, I've used most of the secret stores out there and the Api for vault is probably the nicest

#

And consul+vault makes my kubernetes ventures tolerable lol

lucid latch
#

I got an error on my ubuntu sever where it states FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/home/ubuntu'. Anyone knows how can I solve this? Error message is below.

    from requests_html import HTMLSession
  File "/home/ubuntu/.local/lib/python3.8/site-packages/requests_html.py", line 13, in <module>
    from fake_useragent import UserAgent
  File "/home/ubuntu/.local/lib/python3.8/site-packages/fake_useragent/__init__.py", line 4, in <module>
    from fake_useragent.fake import FakeUserAgent, UserAgent  # noqa # isort:skip
  File "/home/ubuntu/.local/lib/python3.8/site-packages/fake_useragent/fake.py", line 7, in <module>
    from fake_useragent import settings
  File "/home/ubuntu/.local/lib/python3.8/site-packages/fake_useragent/settings.py", line 10, in <module>
    tempfile.gettempdir(),
  File "/usr/lib/python3.8/tempfile.py", line 425, in gettempdir
    tempdir = _get_default_tempdir()
  File "/usr/lib/python3.8/tempfile.py", line 357, in _get_default_tempdir
    raise FileNotFoundError(_errno.ENOENT,
FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/home/ubuntu']```
haughty stratus
#

dudes how do you open multiple py files in pycharm?

#

ping me

true vapor
#

I have a git repo, and the commit history for the first 30(of 50) or so commits is very clean, but after that, they go to shit - I'd quite like to clean it up and make it sensible,

#

Right now the only branch is master

#

does anyone have a guide on this sort of thing? Cleaning up a commit history

frank compass
#

Click on them @haughty stratus ?

haughty stratus
#

i figured it out you just select all then hit enter

#

lol

finite fulcrum
#

Cleaning up things like messages or also their changes?

true vapor
#

just the messages

#

well - I want fewer messages

#

there's like 5 commits in a row that are logging added logging logs :(

lone linden
#

i usually ammend a commit or two backwards, never really needed to wipe 20 commits

#

hmm good question

true vapor
#

it's not really wiping that I want to do - rather turn those ~20 into ~5

lone linden
#

git rebase -i HEAD~N and git squash will be your friends then

tawny nova
#

anyone here configure pytorch with pycharm? I installed pytorch via pip, but pycharm doesn't seem to have the corresponding class definitions and shows warnings for proper functions

true vapor
#

Windows or Linux?

tawny nova
#

linux

true vapor
#

That looks like it's installed correctly

tawny nova
#

yea it works when i run it too, but i'd like to have the proper definitions as well

true vapor
#

The definitions are probably in C/C++, so that might just not be possible

#

if you ctrl+b on it, is that what you get?

tawny nova
#

the type hints just seem to be bad 😦 i was expecting more information in there. thanks charlie πŸ™‚

lone linden
#

it's not really wiping that I want to do - rather turn those ~20 into ~5
@true vapor any luck?

true vapor
#

I'm in the process of figuring it out right now. I've made the master branch not protected locally, and rebased so that i now have a branch called master-rewrite locally with a sensible commit history (from 55 total commits down to 36). I just need to figure out how to force that new branch onto the old master and push it to the remote

#

That last part was easy enough to figure out. More for my own sanity than it being useful, I'm gonna write out the steps I followed: 1) make master unprotected 2) Interactively rebase to fix the commit history on a new branch off master 3) force the rewrite branch onto master with git branch -f master master-rewrite 4) force push

grizzled tapir
#

hello

#

what is the best IDE for python

#

i have the IDLE that comes default with it

#

but it looks clunky

#

it looks like that

#

it is quite strange and too simple maybe?

#

i have used Dev C++ and Code::Blocks before

#

so any recommendations for the IDE?