#tools-and-devops
1 messages Β· Page 49 of 1
Nope, not that one
so i'll just make one then
Yeah
so can I copy and paste
between firefox and vim?
yes I can
alright then what's next?
have to reload it
Yeah
what's
.vimrc
That's the alternative one, typically that one isn't read
huh
like how?
call plug#begin()
Plug `morhetz/gruvbox`
call plug#end()
huh alright
Then reload vim, and do :PlugInstall
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
autoload inside of vimfiles in your user folder, yeah
ping me when you guys r done, i have a git question but no rush and dont wanna interrupt
Sure
I'm not sure what went wrong
I suggest re-running the vim-plug installer
Right, and it did install on vimfiles?
Hmm, am running out of ideas
Right, if the plug commands still don't work, I'm really not sure where the problem is
@soft hare I think we can start with the git question
@drowsy lava i told you to use packadd
:he packadd theres a whole chapter in the docs
Works for vim 8+ and neovim
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
Ideally you'd work on something that's not master
@soft hare that works, or ^2, or look at the log to get the actual commit hash
I'm not quite sure what the ^^ does, but you can checkout to the origin or the exact commit if you wanted
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
If just viewing that should be fine, but if you need any changes just use proper branching
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 :/
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?
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!
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?
Is watchtower what you're looking for?
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
@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
@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 π
I'm revisiting my git aliases. Any of you have helpful ones to add to my collection?
Here's what I currently have. Maybe this will help someone else https://paste.pythondiscord.com/mafawebeza.bash
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?
@tawny temple I have one for git status because I run that command ritualistically, much like I do ls after cd
I also have one for
$ git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
which I took from https://ma.ttias.be/pretty-git-log-in-one-line/
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-> Noneinwork:python def method(arg: Any) -> None:which makes absoutely no sense to me, it's like the@abstractstaticmethodis making it choke
is it because the deco is deprecated?
nvm, I guess that's part of the reason
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
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
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
what terminal are you using?
does calling set termguicolors solve the issue?
I put it in the .vimrc file?
yep, where your other settings are
yes it does
YAY
I have no more thing tho
the noerrorbells part
it has an error bell anyways
it should be off by default, try removing that line?
nope
right, what do you mean by has an error bell? does it ring? flash?
doesn't have?
what
like it doesn't have that slight ding sounds
doesn't have? does that mean you want the ding sounds?
right, can you set visualbell and set t_vb= in your config?
run :help t_vb
nop, you should set it to be empty, that's why the = is hanging
ah gotcha
so it'll work now?
yes it works
the screen flashes red tho
that's fine lol
thanks
the first one is WSL and the 2nd is in windows
I'm not sure why the coloration is different though
the first one looks more correct
@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=
any in depth guides to deployment of django apps
getting it running on a platform is going to be vendor specific, but here's their docs on things to think about when deploying https://docs.djangoproject.com/en/3.0/howto/deployment/
@inland ginkgo try resetting your project interpreter
The version it's pointing to isn't on your pc
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
Brunckek, Docker
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
any editor recommendations?
@eternal flicker it didn't work
what does running :version give you?
what version of Windows Terminal are you using?
try using https://github.com/gruvbox-community/gruvbox instead of the morhetz version?
alright
that broke it
i'm trying a fix hold up
Nope it's still the wrong colors
Right windows, left WSL
I would write in WSL but in WSL a lot of my projects don't work
you said that the right one is Windows?
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?
it's powershell
$Env:TERM
nothing shows up
right, now try setting the environment variable to xterm-256color:
$Env:TERM = "xterm-256color"
nono, this are powershell commands
now if you run $Env:TERM again xterm-256color should show up, then check if the issue is fixed (cross your fingers!)
did you create a new terminal?
I'm stumped
hmmmm maybe just find a way to change the bg color?
Really I just need it to be gray
right, after sourcing your colorscheme, try placing this:
highlight Normal ctermfg=black ctermbg=red
alright
adding in set background=dark made everything this way
so maybe if I removed that line?
hmm, does removing that line change anything?
removing it gave the image with all the white?
yes
but setting it doesn't seem to change anything either
that was in accordance with https://github.com/gruvbox-community/gruvbox/wiki/Terminal-specific#2-true-colors-look-off
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
I wonder if setting your Windows Terminal background works
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

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
@eternal flicker sorry for the ping but I have a new issue I can't copy and paste in vim
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
to access the system clipboard in vim,you have to use the
+register, so"+pwill paste whatever you have in your system clipboard
oh
control p used to work
where do I need to write it in though?
like in a terminal
in normal mode
what is?
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
yep
could you tell me like
your leader key is \ by default
what's leader key
your leader key is
\by default
most of the settings in my .vimrc is copied from a yt vid
I don't really know what most of them does
it's basically a free key for you to sorta "namespace" your bindings
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
https://stackoverflow.com/a/11676244 explains map, and it's related nmap, vmap, nnoremap, etc
so this works with control v right?
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
same as?
with the above bindings, \p does the same as "+p
\P does the same as "+P
so \p = +p then
"+p, note the " character
" let's you select a register, so "+p means select (") the system clipboard register (+), then paste (p)
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
XD
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
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
thx
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
Hey guys
has anyone used SPYDER Ide?
I want to toggle word wrap
can't find the option
it's driving me insane π
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?
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
So that's the basic workflow? I push my solution, he passes his solution, we review and accept if there's no conflict?
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
Okay, I think I understand it now! Thanks! π
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.
Django is pre-included in Anaconda, I reckon.
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.
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
i did that
pipenv shell
the problem is
i get this error
when i run it in windows powershell
i cant look at pastebin at work
pipenv and conda are completely different tools
pick one
@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.
how do i init a pipenv env in a dir
pipenv three
after cd
then pipenv install django
then installed django
yes
and then pipenv shell
then django-admin startproject proj .
then python manage.py runserver
output:
one big fat ugly error
Do you use windows?
yes
then, check with the command "dir" if you're in the right directory.
however, you should be.. π
Strange, check you Enviroment variables there has to be something...
It depends, if you installed python only on your user's profile then user variables.
should i check the variable
path
the value of path is
i see a list of paths in path
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
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?
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
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]")
possibly related to this? https://github.com/python/mypy/issues/6700
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?
The owner probably just prefers doing the merges on their computer instead of on GH
It would still create a merge commit
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
please if you are interested in helping tag me and ill elaborate (also i uploaded it on github though idk if i did it right https://github.com/chrisvrk/onlineclass)
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
@keen oak try with an id, it might work
@sage perch i did but im not sure what the id for the input space i want is and how to find it
Does it have text in it? @keen oak
On the input thing
Smth saying what it does or what to put there
I think driver.find_element_by_text('Your full name').send_keys('your input')
That might work
hol up ima try it
Ok
@sage perch for some reason it says AttributeError: 'WebDriver' object has no attribute 'find_element_by_text'
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
Idk how to fix that
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?
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
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
@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
im still at work, i'll give it a look later if you still havne't found the source of your problems
thanks i have to go now too but tag me and ill answer anytime thanks for the help!!!
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
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()
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.
Would you be so kind to elaborate a bit more on how to implement your suggestion? Very new here.
thank you for your time
It was more said for the sake of completeness than an actual suggestion.
It's not worth doing
Ah, I follow you. I will proceed as my implementation is correct then. Thanks again.
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.
yeah apparently pycharm unlines some weird things
like apparently in django it thinks that calling .object on one of ur instances is invalid
@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.
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??
@mystic flint you need to get those from your AWS account
i thought i was supposed to use this boto lib to get the envir vars. it was just an example...
@mystic flint Please refrain from using profanity similar to that
Even though it's directed at yourself, it can be offensive to some.
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?
Anyone here have experience with Jenkins and robot roles?
@lethal flax can you clarify your situation a bit
file structure, which venvs are active at what time, etc
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?
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
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)
are they on 2 different machines?
what are you passing to poetry add?
and where does that error arise? upon poetry add?
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
what happens if you manually create a venv, poetry install in it, then poetry add
this looks like you somehow inserted venv stuff into the gp_util source
I'll take a look at the tarball
yeah seems like the best thing
also verify that the actual files in your gp-util repo are correct
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
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
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
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
All my projects contain exactly one package
yep. most do
but I'm supposed to use - in one and _ in the other?
no, i just prefer it like that
obviously - cannot be in a package/module name, being invalid as a python variable name
yes hence the _ everywhere
but it's perhaps a good idea to rename my projects then to use -
yeah I get it, I'll consider it for sure
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
the src subdirectory is possible?
yes
i often do src/python actually
[tool.poetry]
packages = [
{ include = "gp_util", from = "src/" },
]
its not just possible, imo its preferred
Allright I will consider it in my overhaul once I get pipenv factored out
Thanks for the tips
does anyone in here have experience with docker?
you'll have more luck if you simply ask your question :p
Is it possible to change local git config [--global] user.name on mac?
@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 toA1:Q15it 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
@tawdry needle If row 16 is filled, will it do row 17 then?
that i do not know
it might shove everything downwards
hopefully the docs clarify
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
where do dockerfile commands install the libraries?
basically to your disc
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?
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
That could actually work yeah, assuming you won't run in any conflict because the two root folders are named the same way
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
yeah ... cron is probably the most simple ... although ... in a linux context, i tend to default to systemd-timers now
https://www.youtube.com/watch?v=n2Cr_YRQk7o ive tried this and a bat file
This tutorial is going to show you how to easily schedule your python scripts so that you can run them daily or even hourly.
The first thing you need to is open the Task Scheduler App that comes included with windows.
Written Tutorial Here:
https://updatelane.com/tutorials/s...
neither work
any advvantages over cron?
what is cron?
ahhh yeah im on windows
@lone linden has more human readable notations (e.g. 1h vs the cron notation) and also they can be templated with normal systemd templates
oh cool, i'll look into it
the Arch Wiki has a good write up: https://wiki.archlinux.org/index.php/Systemd/Timers
archwiki π
but yeah ... i haven't touched windows in ... jeeze, maybe 5 years
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)
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
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
I have one small project
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
I am searching for free Travis is not free
I only want to check my code when I deploy
I mean push
And deploy
Travis IS free ... but maybe no the plugged in version that exists on GitHub
personally ... I prefer GitLab myself
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
deploy to what exactly? there are lots of things that you can deploy to that don't cost anything (heroku / netlify / etc...)
Aws
why not use AWS native things then?
I haven't buyied hosting yet
Ok, then don't ... use heroku or netlify
don't overcomplicate things until you need to π
whats the command to create a terminal with a horizontal split in vs code
make a service probably
@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.
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 :)
@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?
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
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π
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
They will not tell
If they use it for free
And what is parallel build
In azure
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
Yup u can say
So how many push I can do in one day
It allow 30h
For private repo
Each month
Depends on your tests generally
Hmmm
But at least you have an optimization target
10 push a day???
If my build fail and if I try to push again
It will be count 2 or 1
Again, depends on your process. If your tests take an hour to run (unlikely) then you get a whole lot less
I don't have a huge code
Not using azure lol
What is your app? Why is it private
Sounds like it could probably be a serverless function and those tend to be very cheap
So yeah, heroku would be plenty
The "deploy to heroku"
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
lol im not so trusting of these hosting services
Semaphores is ok, I've not used it myself
I like heroku, it's legit
I'm a GCP person myself though
Hmmm GCP is free for private repo?
No
glich layout kinda seemed sus to me imo
There is very little free about gcp
so im sticking with aws
No one ever got fired for choosing AWS lol
Hmmm
glitch kinda made me scared
Hmm
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
they're already banned
oh lol
1x CI/CD job at a time
What this meansβοΈ
I am thinking of giving a shot to simaphore
How can I run CI/CD on my local machine?
here is my pipeline
[warning]The 'junit_family' default value will change to 'xunit2' in pytest 6.0
getting this error
Hello everyone
Can you tell me why doesn't output show in terminal in visual studio code when I select Power Shell?
pls tell
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..."?
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
maybe try using cmd instead of powershell... it's better
2 things
- remove that
python hello.pyfrom the hello.py program, just leave theprint("Hello World")
- the file is not saved for which to a computer nothing was done
that's why you're getting no output
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
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
yes
π
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
you need to save your file or it will execute the same old file
as you can see at the top left "unsaved"...
@timber atlas you mean I need to save every file after execution
yeah
Ohk
or in vs code you can decide to save automatically the file
I am doing python now
yeah
or in vs code you can decide to save automatically rhe file
@timber atlas How do I do that
maybe after delay idk 2sec
You mean after dalay?
yes
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
yeah
I am also using visual code but why isn't it showing that I am using it in discord
Like yours
ok
and if you install it you'll have the same thing
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
Please send me picture I am unable to find
how do i update an image in a docker container
@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
hey all, is this the channel to ask questions for pyinstaller?
Google searched my question nvm.
what's the difference between python venv and docker? They look similar to me. Both are containers
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
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.
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
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)
windows is more stable
that heavily depends on the distro
"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
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β
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
@untold sail
"windows is more stable" 
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.
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?
Please, find it in more detail on stackoverflow, thank you so much
you already have got decent answers underneath
just use a tensorflow packaged container?
you've got correct answers underneath ?
im glad you got it sorted
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?
how can i open a vsc in my second monitor
kk
CTRL+K
@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.
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
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
but still, it often is allowed, so straight up not being allowed to converse about it seems..off
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
fair enough
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
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
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.
Has anyone ever gotten an error that says βclient_loop send disconnect broken pipeβ during a ssh session?
Yep. Usually after I left open a ssh session for WAY too long.
So how can I solve this ?
I am running something that requires me to let it run for a long time.
@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?
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.
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
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
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']```
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
Click on them @haughty stratus ?
Cleaning up things like messages or also their changes?
just the messages
well - I want fewer messages
there's like 5 commits in a row that are logging added logging logs :(
i usually ammend a commit or two backwards, never really needed to wipe 20 commits
hmm good question
it's not really wiping that I want to do - rather turn those ~20 into ~5
git rebase -i HEAD~N and git squash will be your friends then
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
Windows or Linux?
That looks like it's installed correctly
yea it works when i run it too, but i'd like to have the proper definitions as well
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?
maybe its a problem with the specific function though. looks like others have this issue as well
https://github.com/pytorch/pytorch/issues/16996#issuecomment-478422040
the type hints just seem to be bad π¦ i was expecting more information in there. thanks charlie π
it's not really wiping that I want to do - rather turn those ~20 into ~5
@true vapor any luck?
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