#tools-and-devops
1 messages · Page 54 of 1
The PyDis stuff is running on Linode though, we are sponsored
ooo
But uses Azure Pipelines for CI, and SaltStack for CD
And azure free tier can run my docker too at testing ?🙂
I don’ know any cool youtube video though, sorry
Np
udemy has a bunch of courses - granted, at the moment their promotion has ended
however... you MIGHT be able to find the same course.. elsewhere.. if you catch my drift
https://www.oreilly.com/ always has a free trial with no CC required and they have tons of video courses on just about anything
Has anyone managed to use p4python on windows? I ran the installer and it seemed to work but when I include it in my project it fails to find it
It is a CD tool
Basically, it is here automate the deployment of your bot
so yes, you can
Salt will trigger a deployment on your host, so azure would host docker and will recieve instructions from salt
Yea, that’s not the way to roll on Azure
Actually I am new to all this stuff my bot is on heroku
And I wnt to use azure+salt on that
And docker also
Ty Akarys and Rabbit
Azure + salt is not a combo
O
Azure DevOps can push stuff directly out
They use it but it’s not the way to roll with Azure
azure has a container deployment thing?
i know about service fabric
actually is there a host where i can just give them my dockerfile and they run/host it for me? id happily pay money for something like that
not necessarily a website, but usually i just need a few TCP ports exposed
things like ZNC
Sorry, I saw VNC, they don't have a cheap way of running non web container
what do you mean "non web" container
oh, like something other than TCP port 80/443
i mean it doesnt have to be azure
im just curious if such a thing exists
well can i get pycharm edu from my school mail id?
yes
and what is the differene between
edu and
prof
instead, get github student pack
oh where is it?
edu is prof version
never heard of it
just google it
the professional version has extra features to integrate with various testing and web frameworks
okh, but as iceman isn't edu same as prof?
so i need to make a account?
well lemme search google
will let u know if prob occurs
first, get github student pack, it includes pycharm prof
okh
i got mine by sending them a picture of my identity card, as I was still in my high school and no school-specific email was provided
that gives a lot of stuff
yes
how would you guys allow ssh by state
like lets say i want to allow all IPs from a certain state to be able to access ssh
but nothing else
question @proud trout what does "$100, $50 in azure (etc.) credits" mean?
that much worth of stuff is free
Does anyone here work with pipenv inside of docker?
I'm having issues with the packages being available to the python interp inside of docker-compose
Does anyone here work with pipenv inside of docker?
@broken eagle What issues?
I have a Pipfile and Pipelock file that includes things like Pandas and Pyarrow. When I use docker-compose, it pulls in the Pipfile.lock and then deploys those dependencies within the container. However, when I attached Pycharm to that container as a remote interp, it says module not found when I "import pandas as pd"
My best guess is that the paths are off, but I'm not sure.
I dont use Pipenv myself but I have heard that you need to provide --system switch to pipenv install command
so that you install you deps on the global path instead of a virtual env
Yeah, I saw that. I think I tried that at some point, but waiting for pipenv is such a slow process, I've worked on this for a day and half... and am not sure if I made some other strange change that prevented --system from working.
I'll keep poking at it
@broken eagle I found Pipenv very slow too
Thats why i switched to Poetry
Its easier too
Pipenv plays with Pipfile.lock for too long. Its very annoying.
yes, very much so
have to use pipenv for this project, otherwise I would try something different
Use alpine images
No
As for pipenv In docker, it can add complexity where it’s not needed. Maybe see if you can use pip with requirements file.
@wooden ibex Wow that was really insightful. I will look more into this.
Hey everyone, have a question on Celery, Django, and Ansible. I have a playbook that is going to take "some amount" of time to run, which I expect to be longer than the timeout on the HTML server for Django, and I've seen Celery mentioned as a solution, but to me, it looks like it's "just" a task scheduler, and I'm not sure how well that'll play with Ansible, since i'm submitting the playbook as what would be one task (I think)
But I agree with their advice, I’ve had similar issues.
@wooden ibex time hasn't been a problem but yeah figuring out dependecies can be quite difficult
Slim is pretty good without BS
what is low memory error in pycharm ce?
I'm using python 3.7 image. Not sure if that's built off alpine
what does FROM say?
I'm using python 3.7 image. Not sure if that's built off alpine
@broken eagle It's probably not
on my pycharm, it came a low memory error, it didn't come anywhere else in the stste
Im using
system*
FROM python:3.7 AS base
so stock python
which is pretty big I believe
my docker is firing up so I can't see
python 3.7 84d66a048f90 4 months ago 919MB
part-ay
im just tired at looking at Installing dependencies from Pipfile.lock (edf710)…
again, I don't know pipenv but does it make requirements.txt file?
or can you tell it to?
im required to use pipenv and pipfile for this :\
why?
assignment
Copy the pipfiles into the container and run pipenv install --deploy --system
You can attach a shell to the container and run the python repl to test that the dependencies installed successfully
What does --deploy does again?
Is pipenv part of default python images?
@tawny temple that's what I'm doing
Rabbit, no. You have to apt install pip, then pip install pipenv
WW
So isn't it just a PyCharm issue?
Can you set where it looks for the interpreter?
Though I don't know how it could find an interpreter separate from the system interpreter.
It doesn't make sense.
Are you sure it's actually using your container?
hey um so for sublime text the command palette only comes up with the keyboard short cut only if i use the ctrl key on the right side of my keyboard- is this intended or something?
pip is default in python images
FROM python:3.7-slim
#Run PIP install
COPY requirements.txt .
RUN python3 -m pip install -r requirements.txt```
Yep, i used to use poetry inside my docker images too. Then I realized that is useless since docker is absolutely virtualized from my system and there is no need for an additional python virtual environment and slow down the process, and increase image size.
If you're not using poetry then you're not using the lock file, which means you're susceptible to deploying with different dependency versions.
Unless you converted the lock file to a requirements.txt
requirement files is needed for sure
Unless you converted the lock file to a requirements.txt
@tawny temple I am doing that.
poetry has an export option and i use that in a git hook, that way it is always updated
A local git hook?
That doesn't sound reliable.
why?
Because you cannot ensure every contributor has the hook installed
other team members always have a reliable copy of requirements on their system
it is their responsibility to use it correctly
Are you checking in the requirements.txt?
ofc
Then it's possible for someone to check in an updated lock file without updating requirements.txt
im checking in requirements.txt poetry.lock and pyproject.toml
Then it's possible for someone to check in an updated lock file without updating requirements.txt
@tawny temple their PR would fail, since I have CI setup
I would have just done it in CI to begin with
Can you explain a bit?
this is thr best method I have come up with
I'd like to know how experienced people do it
I personally don't care about having a requirements.txt file checked in. So I'd have the poetry lock file exported in CI. If anyone needs to build containers locally for some reason, then they can manually export the file before building (or write a short shell script that combines the export and docker commands).
But you may like having a requirements.txt file checked in cause it means no one ever has to rely on poetry to install it as-is.
github action sounds like a great way to export poetry into requirements.txt for building
or they could install poetry on their docker image
github action sounds like a great way to export poetry into requirements.txt for building
@wooden ibex Yeah that's a CI
Installing poetry in docker would be slower, but yes, they could
At least as a multi-stage build
it's quite slow lol
and in alpine you have to install a bunch of stuff
not worth wasting time over
How does CI fail though in your current setup?
You said it fails if the files are out of sync
earlier my tests used to take 15 minutes with all the poetry bs, but now i removed it and takes about 10 minutes
You said it fails if the files are out of sync
@tawny temple my build is failing these days but it's not a dependency issue. It's a permissions issue inside docker that I can't figure out lol
Well, the main concern I have is that the files can go out of sync since you cannot enforce contributors to properly have hooks set up. I'm not sure how you could check they're in sync in CI either.
You are right there. But since my project has no contributors, it doesn't matter
Actually, you could export in CI and then ensure there's no diff. But that's only if you want a requirements.txt checked in for other reasons I mentioned. Otherwise, that'd be redundant and you could just solely rely on the export in CI.
Yeah that's what I should probably do once I invite some contributors
I keep looking at Poetry but I'm confused what it does besides combine virtualenv/pip into single stages
It has a lock file which ensures consistent version for all sub-dependencies
Well, I guess that's like pip freeze
yea
Yeah you are basically right
It just tries to package it into something more convenient and integrated
but I don't switch python versions or heavy development
so maybe I haven't hit the need for it
one major reason i like poetry is like consider this pip install jupyter installs a bunch of dependencies but pip uninstall jupyter removes only one package and i get an invalid requirements.txt
poetry takes care of version solving elegantly
I think pipenv does the same but it's freaking slow and annoying
I see
I use poetry to build packages and publish them to PyPI. It's fantastic for that.
Is there a way to put debug logging in a python package that gets removed at packaging time? Similar to flutter tree shaking with kReleaseMode (https://api.flutter.dev/flutter/foundation/kReleaseMode-constant.html)
Logging uses different logging levels. The standard library's logging module supports a debug log level. You can use an environment variable or some command line option to determine whether the debug level should be used.
If the logging level is higher than debug, debug logs will not be shown.
tip regarding logging, while it is true that logging.debug("debug %s msg", arb_obj) will only emit if level is debug or higher, be careful with f-strings and the like, where logging.debug(f"debug {arb_obj} msg") will compile the f-string regardless of log-level. which may or may not matter to you, depending on how tricksy arb_obj is to serialize.
Thanks for the tips!
Is there any way to find official documentation for a specific command?
I can't find documentation on:
my_dict.values()[x]
I only get things related to dictionary.values(), but nothing directly addressing directionary.values()[x]
Specifically that ()[x]
@tropic ibex () is just part of .values()
my_dict.values() returns a list-like thing, which supports accessing elements with []
vals = my_dict.values()
vals[x]
you can do this, right? so
my_dict.values()[x]
is the same
!d g dict.values
values()```
Return a new view of the dictionary’s values. See the [documentation of view objects](#dict-views).
An equality comparison between one `dict.values()` view and another will always return `False`. This also applies when comparing `dict.values()` to itself:
```py
>>> d = {'a': 1}
>>> d.values() == d.values()
False
actually im not sure that object does support []
in fact im pretty sure it doesnt
where did you see this? @tropic ibex
Saw it used in a test code in some tutorial
Thaks for the explanation btw.
It worked, that's why I was fascinated.
!e ```python
print( {'a': 1, 'b': 2}.values()[1] )
@tawdry needle :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | TypeError: 'dict_values' object is not subscriptable
was it a python 2 tutorial?
iirc .values used to return a list in python 2
don't use python 2
!e ```python
print( list({'a': 1, 'b': 2}.values())[1] )
@tawdry needle :white_check_mark: Your eval job has completed with return code 0.
2
I use
poetryto build packages and publish them to PyPI. It's fantastic for that.
@obtuse rapids Any guide on how to publish your package using poetry.
i think poetry's website has one
Yes it's very straight forward.
how do i add my pycharm presence on discord , i am using pycharm community version an ubuntu 18.04
hmmmm i put the discord intregeration but doesn't work
why its not working i just started
python executable not in $PATH
Strange. At least, Atom can't find it.
you may not have put a build of it i think
ok i got that rich presence plugin but it still doesn't work
you get used to it when i started it was hard at first but when you get the hand of it you will be ok
Hi everyone, bit of a noob question but I can't set up a python environment on windows with venv for some reason
I keep getting this error:
PS D:\Home\USER\Documents\Development\Python\learning_dj> python -m venv learning_dj
Error: [WinError 2] The system cannot find the file specified: 'D:\\Home\\USER\\Documents\\Development\\Python\\learning_dj\\learning_dj'
Anyone familiar with what's going on here?
Nevermind it was a Windows thing
Controlled Folder Access was blocking it
Wait nvm with CFA off it still doesn't turn on the virtual environment
ohhhhh I needed to use the .ps1 not the .bat
ok
Question : What IDE you recommend for python (i.e PyCharm, Atom, etc.)
i personally use intellij
but vs code is also good
for editor speed sublime is epic but it has no intellisense
but vs code is also good
@vague edge I use vs code for HTML, I might search up info about intellij then !
dude epic
did you guys use tasks to run python scripts in VScode?
yeah i do
do you use conda?
nope, i am more into web dev
when I select my environment in the bottom left it doesn't translate to the task
ahh
when I select my environment in the bottom left it doesn't translate to the task
@cerulean flame it should
vscode always activates virtual environment before running tasks
are you thinking of launch instead of task?
no I'm talking about the tasks that are defined in tasks.json
im on windows so I don't know if that's the problem. I try to run python it is uses the python from base instead of the one I select.
maybe you can chain commands?
yeah that's fine too
performance should not be a problem
conda just reroutes your command to the correct virtual environment, nothing more
on my pc, I was using the defaul launch.json way of building the project but I had isses w/ it
building is a bit different
it would activate run and deactivate the environment but i found it was slower than clicking the terminal w/ the active env and hitting up to run previous build command
im looking for something faster
hmmm
maybe a script which does all this and then a task in tasks.json?
that runs this script ^?
I haven't tested conda run yet
hopefully its faster
im trying to find a faster way to build then just moving my mouse lol
conda is weird allowing you to use base version of python w/o activating the env
not sure i like that
Hey guys, was directed here for my issue at hand. Hope you can help. Not sure what exactly is the issue and it seems like a basic one tbh.
Basically not getting any commands to work, or well, most of them aren't, some are still working.
Like this issue right here simply trying to make a venv folder. Or listing pip I get that pip isn't a valid command either. Not sure exactly why this is.
I've installed python to VSCode, then Anaconda, then I also installed Git. That's it.
Yes ofc
what's the output which python
which: no python in (/mingw64/bin:/usr/bin:/c/Users/Rocinante/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/cmd:/c/Users/Rocinante/AppData/Local/Microsoft/WindowsApps:/c/Users/Rocinante/AppData/Local/Programs/Microsoft VS Code/bin)
Might have something to do with Msys
can you change your default shell and try running python again?
This is on powershell
And CMD
Somethings off.... On my laptop, which is W10 based as well, I don't have this issue really. Although I also have more choices when it comes to choosing interpreter (like 32 and 64 bit)
definitely weird
vscode is detection python but your cmd, git bash or powershell can't
hey guys, I'm currently teaching introductionary programming and got a technical issue at the school I'm working at - no admin access chromebooks for all the students, trying to figure out a way to get some form of IDE that supports pygame and/or flask
anyone got any suggestions for a cloudbased solution or any other tips?
currently, we're running google colab 'cos of google integration for the rest of the schoolenvironment, works fine, except, no real support for pygame
Can anyone help me get vim rich presence? (please @ me if you would like to help)
@spiral ore what does clicking the thing in the bottom left corner show
the "conda" text
It was just the conda interpreter, nothing else. I just uninstalled everything and removed all folders and will try with a fresh install. Maybe the "install path" wasn't ticked or something, who knows....
But I'll try that tomorrow. Gotta sleep now. Thanks anyway guys, much appreciated!
Guys how could i get my computer audio?? (obs: its not the microphone)
like in real time
Why does flake8 complain about __path__ being "F821 undefined name"?
Pycharm question: how can I update my interpreter? Switching it in the settings window doesn't let me update from 3.7 to 3.8
@ember relic redownload from python.org
anyone know whats wrong with line 5 im stuck
driverage = 0
licence = 0
driverage = int(input("please enter your age"))
licence = int(input("do you have a drivers licence? 1 for yes, 0 for no"))
if driverage >= 17 and licence = 1:
print("You can legally drive cars on the road!")
else:
print("You cannot drive on the roads!")
@restive fable for the future, this is better suited to the general help channels, as your question doesnt havevanything related to #tools-and-devops
@ember relic what OS are you running?
There are a few ways if your system requires a specific version.
You can install anaconda or run things through docker
Yes, I know this is sloppy code but im just testing for now. How would I go about making it so if I type XXXXX it will replace those inputs with a random string or number, and it will do it for any variable i type in the input
Is is possible to cache joblib output to a Csv of JSON and pickle?
@heavy knot A for loop that iterates through each character in the input, with an if branch that selects from a different character pool depending on the input character, should do the trick
How would I make it go through each character
actually lemme rephrase that, i know how to make it go through each character but how would i make it replace it and then put it all back into one line
this is the simplest form i know
somehow removing the inpstr line fixes it but when i keep it there, it says invalid syntax at print(s, end = "")
you're missing 2 close parens at the end of the prev line @heavy knot
also you don't need the ''.join since random.choice already returns a string
K it works now but its not replacing anything
import string
from ctypes import windll
def get_drives():
drives = []
bitmask = windll.kernel32.GetLogicalDrives()
for letter in string.uppercase:
if bitmask & 1:
drives.append(letter)
bitmask >>= 1
return get_drives()
if __name__ == '__main__':
print(get_drives())```
I know this is wrong but I'm not sure how it is wrong. Also when I use if name is main does my file name need to be main or should I change that to the actual filename?
changed:
for letter in string.ascii_uppercase
and
return drives
What are you doing?
now this is what i have. Hmmm....
Its kind of doing what i need it to do. Its replacing but i need a random character for each character, not the same random character for each one its replacing
so like XXXXX would turn into AK1CH or something like that, its all random
This is for Tools/Devops work
for me or spencer
that was for you
i just now understood that channel, i thought help-name was some sort of install for python not the name of the help
thanks
is there some tox equivalent but specifically based on pyenv
I'm trying to backup a drive when plugged in
Currently I have my script checking for drives then when a new drive is detected it makes a new folder on my desktop and uses robocopy to copy the drive data over
I'm trying to use check_output to run robocopy but right now it is timing out.
Now I have most but not all of the drive copied
I was able to get it to run I think the exit is just not clean
I want to use python because I'm trying to learn the system stuff in python
-edit added "in python"
I use powershell all the time :p
import os
import string
from ctypes import windll
import time
from subprocess import check_output
def get_drives():
drives = []
bitmask = windll.kernel32.GetLogicalDrives()
for letter in string.ascii_uppercase:
if bitmask & 1:
drives.append(letter)
bitmask >>= 1
return drives
if __name__ == '__main__':
print(get_drives())
before = set(get_drives())
waitfordrive = input("Please insert USB drive now, then press ENTER: ")
print("please wait...")
time.sleep(5)
after = set(get_drives())
drivestatus = after - before
delta = len(drivestatus)
if (delta):
for drive in drivestatus:
if os.system("cd " + drive + ":") == 0:
newly_mounted = drive
print("There were %d drives added: %s. Newly mounted drive letter is %s" % (
delta, drivestatus, newly_mounted))
check_output("robocopy \"%s:\" \"C:\\Users\\Spencer-IT\\Desktop\\%s\" /mir /r:5 /w:15 /mt:32 /v /np /log:backup-py%s.log" % (newly_mounted, newly_mounted, newly_mounted), shell=True)
else:
print("Sorry, no new drive was detected.")```
How can I make this better?
Comments and docstrings
@errant gyro as a matter of style, i would write all that code under if __name__ == '__main__' into a main() function, then just do
if __name__ == '__main__':
main()
if (delta) should probably be if delta != 0
drivestatus is a bad name, how about drive_diff?
if os.system("cd " + drive + ":")
dont use os.system, do this instead:
if os.path.isdir(drive + ":")
or better yet
if os.path.isdir(f"{drive}:")
also i'd avoid using % interpolation in general
f-strings tend to be easier to read in my opinion, especially if your text editor has good syntax highlighting
what should be the best approach to start build automation framework for Rest API?
I'd like to use nose2 framework for automation
@robust sandal are you sure about nose2? Looks like pytest is a much better option.
yeah nose2 is my requirment
If you do choose pytest, feel free to dm me, since I am also working on testing a django rest api with pytest
Hi! i just had a question about porting over code from python 2 to python 3. I have to update a codebase where some of it is python 2 and some of it is python 3 and i was wondering if there is an efficient way of differentiating between the py2 and py3 files
What is the reason behind this recommendation?
if os.system("cd " + drive + ":")dont use
os.system, do this instead:if os.path.isdir(drive + ":")or better yet
if os.path.isdir(f"{drive}:")
@tawdry needle
Is it a security concern?
partially yes
but more generally it just makes a big mess
not to mention portability concerns across different shells over time and different machines
which might not matter to you, but its a good habit to avoid using it unless absolutely necessary
plus, your intent is clearer when using os.path.isdir anyway
I thought it made it more portable, but I have not used it in a long time as well
os.path.exists could work too
How would I know the best time to use subprocess.check_output() vs subprocess.run()?
@errant gyro use check_output only if you need to check the return status. use subprocess.run if you want to do other things
I am confused how i could write this function to find a line of 4 in a connect four game that i want to code for a project
Is that the google foo bar?
Or is that the one inside pycharm... Anyhow feel like I have done that before but can't remember what I did
@meager saffron As the channel name and topic state, this channel is for tools and devops, of which your question is neither. You should claim a help channel to ask that. #❓|how-to-get-help
@meager saffron also this looks like homework. please note that we cannot hand out homework answers, but we can help indirectly by clarifying material from your classes and directing you to other learning resources
Can anyone help me get vim rich presence? (please @ me if you would like to help)
@frozen pier anyone?
I'm using tox for test automation, and would like to ask- how do I install different python interpretors without changing my default python interpretor (3.8.5)?
i use Arch btw
I have multiple Python versions on my Manjaro system through pyenv to facilitate tests through tox
On Travis CI on the other hand I just have to configure the build matrix to ensure concurrent builds across versions
@dusty maple can you please link some tutorials to do this? I can't find one, and don't want to mess up my default python
Here's one though be wary as it doesn't list the dependencies for building CPython in Arch. https://realpython.com/intro-to-pyenv/
Right after that, I typically do: (replace x with the latest patch number)
$ pyenv install 3.8.x
$ pyenv install 3.7.x
$ pyenv global 3.8.x 3.7.x system
This makes python3.8 and python3.7 available globally
Can anyone help out with figuring out the text editor atom?
Which is better, PostgreSQL or MySQL
@dusty maple thanks i'll look at it
@dusty maple I get Interpretor not Installed even though I did pyenv install 3.7.8 and then pyenv global 3.8.5 3.7.8
@leaden tartan Are you able to invoke both interpreters just fine?
@dusty maple The answer is no, but I got it working. Thanks!
https://stackoverflow.com/questions/64027528/how-could-i-get-my-intern-computer-audio-in-real-time
Guys could you help me 👆
If I had a RAID 0 and the controller died, but I have another controller can I connect the drives to a new, but different brand and model of RAID controller, can that work? If so will it take long to rebuild or for the RAID controller figure out the layout of the disks?
Maybe
Apologies, new to this channel. Ran into a very unique python3.7 error, found on a docker cloud container when site randomly threw a 504 error:
Sorry
importlib/_boostrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject?```
is it possible to setup Travis CI so that it automatically publishes a package to pypi once all tests pass?
Generally, yes. You can create a step that uses twine to perform the upload. I'm not familiar with Travis specifically.
I don't personally use twine, i use poetry but the process would remain same as what I'd do locally, right?
Yeah, if poetry lets you upload then you can use that
it does
Just execute the same command you would locally I guess
Make sure whatever secrets you need are available in CI
Yeah. Also is it possible that the package is published only from the master branch?
i develop on a different branch and push to master every now and then
Generally yes, but how you accomplish that depends on CI. I'm not familiar with Travis as I said
I want only this commit to be pushed to pypi under a new version
You need to look for how to create conditional steps/jobs
And typically you have some predefined env vars set by the CI like the branch name. You can use that in the condition.
I'm familiar with both Azure and GH Actions.
hmmm, gh actions feels a bit weird to me
it has this weird syntax that I find difficult to familiarize myself with
but anyway thanks for the pointers
Azure gets more complicated when it comes to syntax 😄
Has template stuff that can get quite ugly
Basically abusing YAML at that point
do people follow the pep8 standard of 79 chars? I find that very restricting and increased mine to 90 chars but I feel like I am cheating somehow.
No. That's probably the most ignored thing in there by people who otherwise follow it
i usually do 100 or so
yeah I used to see a lot of projects which would have theirs increased to 100 amd would laugh at them. but now that I am working on a serious project, I see where problems creep in.
in a lot of "business code" i see, sometimes variable names can get long
yeah. absolutely_dont_change_this_var = SECRET_KEY
i find that long imports can be minimized using brackets and __init__.py files are really helpful to minimize import code
sure. however i find that too much happening in __init__.py can make it hard to follow code in big applications
i'd rather just have long chains of imports
obviously with good IDE support its less important
atm, my init files just have the imports and an __all__ variable to stop my linter from complaining.
but I've seen a lot of projects using init files as more than that
especially django has a few Exceptions declared in init files
How to run aria2c on python?
Iam using termux as the CLI
For example.
Python = checks link if valid and online
Python, passes the link to aria2c and start the download
Hi there, I'm wondering if anyone has a solution to fold multiline strings in VS Code?
Does Python3.8's typing module have some kind of functionality for a function type?
I imagine something like this: (I know this is a stupid example, it just shows what I'd need)
def f(func: Function[int, dict]) -> dict:
return func(1)
(I presume this counts as tools, cause its direct type documentation, which editors mainly need)
@grizzled pike You're probably looking for the Callable type
yeah
tho... yay... no keyword arguments (which i'd need), but i can deal with that
thanks! ❤️
um, do someone know how to fix this bug i have in pynput? I am doing Controller.type("string") and it doesn't work, here's the error I'm getting: TypeError: type() missing 1 required positional argument: 'string'
@heavy knot you're on windows?
@heavy knot is it on your path?
sorry for late response
im on windows
and my path is fine
okay
now its working
and i havent done anything at all
weird
If you reboot your machine, that could be reason
or if you restart cmd, that could be another
hello, i have problem
FROM python:3.8
WORKDIR /app
COPY . .
RUN pip install -r requirements.txt
CMD ['python','server.py']
that's my docker and it says me: /bin/sh: 1: [python,server.py]: not found
wtf?
what does your directory structure look llike?
python3?
shouldn't really matter, tbh
@hearty swift Replace the single quotes with double quotes - https://medium.com/engineering-zemoso/docker-single-quote-vs-double-quote-the-debug-hell-5149cf5177cb
can someone help me with Git
i add some files to the .gitignore but they still ask to be commited
why is this happening
They'll stay tracked if they were tracked before the gitignore was added
Hi, Could someone please help me setting VS Code up?
It's incredible hard to do anything in that thing
@cyan scarab they can be removed though git rm --cached filename
@obsidian torrent what's the issue?
hmmm, ok i will push from terminal 😄
@obsidian torrent what'd you like to do in VS Code?
can i push my code to a new branch from the pycharm app?
@supple venture you have to change branch first
!resources @bronze kite
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
recomend me a good tool
How do folks here set up a local repository for installing inhouse packages with pip?
I'm using twistd but I'm seeing very weird behaviour on its part with regards to tar.gz files.
@bronze kite for editing py files? Vscode
PyCharm! 🙂
yeah both work fine
@leaden tartan if you are using vscode, don't you have the multiline string wrapping issue that i've mentioned yesterday in this channel?
i don't, but that's because I don't really use multi line strings except for documentation for my methods.
and there's a way to have multi line strings with code folding but it's a bit weird
I've tried to install the explicit folding extension (https://marketplace.visualstudio.com/items?itemName=zokugun.explicit-folding) but then i can only fold python code at the multi line strings 🤦♂️
eventho it says vscode will do the default + the ones defined by the extension
@leaden tartan no bro i am going to start learning python thats why i asked you guys that suggest me start up development tools, that i would start my practice and further I’ll go to next tools
@leaden tartan thx
!resources @bronze kite
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
hi
So I installed Anaconda Python and VScode a few months ago. I'm on MacOS.
Until a few hours ago, VSCode worked fine, and I could run everything in the interactive window. But then, I downloaded a new .py file, opened that in VS code, and I believe I clicked on something that might have changed my version of python or the editor that I'm using or something. Now, I can't run the python interactive window at all.
nevermind i fixed it
holy sh
its been lik 2 hours lol
I have been reading up on semantic versioning and came upon this line
Software using Semantic Versioning MUST declare a public API. This API could be declared in the code itself or exist strictly in documentation. However it is done, it SHOULD be precise and comprehensive.
Can anyone explain what this means? What API are they talking about? I am making a package that will follow this versioning system, but it doesn't have an API, it's not a web-app.
For reference: https://semver.org/#spec-item-1
@leaden tartan The API that it's talking about is the interface that your application exposes e.g. the signature of the functions/classes/methods you're exporting or things like constants
e.g. suppose to say that on x.1.x you have a function with the signature of
def foo(xs: int) -> int:
```turning it into a
```python
def foo(ys: float, xs: int) -> int:
```e.g. making it backwards incompatible when upgrading to `x.2.x` doesn't make sense
So basically, it wants me to write documentation?
It wants you to declare an interface that isn't volatile
So basically, I have to declare one function syntax and stick to it for the entire lifetime of the project?
You can always make a backwards compatible change that also changes the function signature
Ok, but it also says that a major updates like 1.x.x to 2.x.x can introduce backward incompatible changes.
Yes
Hi everybody! I don't know if this is the best place to ask, but I'm looking for a framework that can help me build a robust api based on the aws services (or any other recommended cloud). Which one do you recommend? I can adapt to any language, but my current backend is mostly in python, so the migration would be easier if the framework is also in Python, but I prioritize how complete and robust the framework is more.
@heavy knot FastAPI or could convert to Lambdas
+1 for FastAPI
currently my endpoints are defined with flask, with FlaskAPI the development and deployment to Lambdas is easier?
Lambdas are complete rewrite
you can keep rocking FlaskAPI
FastAPI is better, FlaskAPI isn't terrible
hello everybody
i have a problem that i want to solve
it has to do with the black formatter
and the vscode python extension
long story short i need to find which file within the extension tells vscode how to execute black
coz i need to change the args that it gives it
@onyx zodiac https://stackoverflow.com/questions/50725888/vs-code-python-black-formatter-arguments-python-formatting-blackargs
no, no, i know about that
but i want to remove the default ones
when formatting code vscode calls black like this: python -m black --diff --quiet <file>
i want to remove those two args
hey can anyone explaing what kubernetes is and does?
It's a vast concept. If you don't know docker, I suggest you get started with that
ohh, okay
I think this is kind of the wrong place to ask that too
kubernetes is a tools used in devops so it's not entirely wrong...
but yeah, it was useless to ask here, they would have been rerouted to Google anyway
Is it possible to get data from, for example, steam / epic (% of download) or spotify running in the background (volume or name of song)? So that it runs in the background, what tools to use?
In Visual Studio Code with Microsoft Language Server and IntelliCode, IDE doesn't autocomplete or show information about nested methods and objects from non-standard packages (like pygame). How can I fix that?
anyone know how to decrypt a batch file?
@hushed plume a: wrong channel; see #ot0-psvm’s-eternal-disapproval b: need to be more specific
This is sort of a packaging question, so I hope it fits here. I've built a CLI with click that I intend on putting on PyPI. I need to include two image icons for part of it, but they just don't seem accessible by the package (running after pip isntall -e .). The images are in MANIFEST.in, I can see them being included in the builds from tox and setuptools so am I just brain lapsing on something fundamental? What's the right way to include some arbitrary files in a package?
Can someone tell me how some packages add executables to path? For example pip install pytest adds pytest to path automatically. I looked at pytests source code and did find an interesting line here (https://github.com/pytest-dev/pytest/blob/master/setup.cfg#L63), but I have no idea how the actual thing is done.
@leaden tartan I'd assume console_scripts is set somewhere in the setup.py file
@dusty maple nope that file is empty, atleast for pytest.
yeah and pytest:console_main which should generally point to def console_main in a file called pytest.py doesn't exist.
Yeah, seems like they use
setup.cfgextensively
@dusty maple they do, but it doesn't make any sense to me
Seems like they export console_main in pytest/__init__.py https://github.com/pytest-dev/pytest/blob/f324b27d02e48294e5f1e97e9d5c4f2f53e6888f/src/pytest/__init__.py#L7
hmm yeah. Can you tell me some keywords that I can look up so that I can learn how to do this?
I don't know what to look for
I typically just go for python packaging
that's too broad, it just brings up packaging basics
I meant as a prefix for most of my searches
Well thanks. I'll look into it.
@dusty maple found it. turns out it is pretty easy https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html
hi, any user of poetry? I've some issues trying to run this package https://github.com/PrVrSs/idl2js/, I installed the package, and I'm able to run make and show tests working fine, but I can't exec main.py I got ModuleNotFoundError: No module named 'idl2js'
@heavy knot i use poetry but this doesn't look like a poetry issue
I understand, but it's more to be sure I did everything right, if I run poetry run python idl2js/main.py I got no output
here's the workflow I'd follow
git clone project
cd project
poetry install
poetry shell
python idl2js/main.py
@heavy knot
also from what I see, main.py isn't the main entry point
right, I did the same, do you have 5min to check the library? I'm noob at python and maybe I'm missing howto execute it
how then? it seems it gets -w to get the idl file right?
right, I did the same, do you have 5min to check the library? I'm noob at python and maybe I'm missing howto execute it
@heavy knot maybe ask the author to include setup instructions in README?
I did it a week ago, no reply
how then? it seems it gets -w to get the idl file right?
@heavy knot i have no idea, the README should take care of stuff like this
but bottom line, this isn't a poetry problem but just inadequate documentation
thanks, I wanted to confirm it
not sure what to do I'm not understanding how the tool works
the readme is "this input, this output" but no examples, and make shows tests but not how that works
yeah you should open an issue in their github
last commit was about a month ago, so the author would probably reply
I wrote to email, if he doesn't reply I doubt he will using issue in github
most of my questions on github unless is a big project are ignored
I understand no one wants to give free support to others, and they are more like, there is the code, your problem now if you want it
a bit frustrating when you are not a python developer and they use poetry or another package dependency manager I've ever used
as i said, this isn't a poetry problem
I agree
just open an issue, if it doesn't work then oh well just move on
thanks again IgnisDa
do people actually use autodoc extension that Sphinx provides? the only python package using it is flask from what I see
https://github.com/python-trio/trio/blob/master/docs/source/conf.py#L79 it seems trio does (though idk sphinx so it may not actually be used...?)
yep i use autodoc
saves a lot of typing
i use sphinx-napoleon with google style docstrings
so its the best of both worlds, i dont have to pollute my docstrings with tons of rST markup, but at the same time i still get to write all my docs inline and only in one place
@tawdry needle i can't get it to work though. Perhaps you know a good tutorial or maybe have a repo using Sphinx and autodoc that i could use to learn?
i had a lot of them at my previous job, i havent made one for personal use yet
for the most part it was just a matter of sticking the .. automodule:: foo directive in the foo.rst file
and some other syntax to get a basic table of contents on the front page
then invoking sphinx-build
@tawdry needle so is there a way to get all the docstrings for a particular project without having to create corresponding rst files for them?
what do you mean "get all the docstrings"?
you can do multiple automodule directives in one rst file
now that I think about it, get all modules would be pretty stupid. I think I have to read the docs for Sphinx a bit more.
does anyone know why my linters arent working
in my settings.json file, i have pylint and flake8 enabled
normally it would give off 3 errors in that code (nonexistent module, whitespace in 2nd line, lack of empty line after end of file)
but for some reason it doesnt show anything
i had 2 linters enabled before and it worked perfectly fine
im not sure why it suddenly doesnt work
an update break?
hmm
wait how do u check updates
wait nevermind i found the updates
im not sure if update caused it
but my linting did break like 2 days ago
i dont remember when the update was
if you're on windows, updates can be downloaded from vscode website
otherwise use your package manager
anyone know of a way in pycharm to have a macro/hotkey run a script on the current text selection in the ide and insert the output back into the current file
think parsing a class and automatically writing the docstring
i already have a script that does what i want given .txt file with the text selection and prints the output, but id like to be able to run it on the fly given a text selection from the ide
@dense forum check the extension log under the output tab
ok
i dont see anything wrong with it
@sly sleet what would be in the extension log that i should look for
i found this under "Python"
huh that's weird
Technically once an issue is fixed, shouldn't all the developers automatically approve?
one said to not close it until they review the code and test themselve
Well since the developers don't approve, you probably shouldn't close it
Team work is a thing last I checked
ok i want to annoy them by closing, so i was looking for someone to back me up but ok i guess to leave open now
Team work is a thing last I checked
@leaden tartan oh
Just make a change.org then lol
hmmm probably get thrown out to the street man
is there good guide on how it explain everythin for git and how to use good practices etc, in noob language
or does this just come with experience?
Experience always works but to use that experience, you need to have the knowledge in the first place
https://www.atlassian.com/git This is a good one if you are a reader
Learn Git with beginner to advanced Git tutorials on workflows, git commands, git migration and code review.
https://www.youtube.com/watch?v=HVsySz-h9r4 Corey Schafer has a video but it covers just the basics
Git is the most popular version control system out there and for good reason. In this video, we'll go over the basics of what git is and how to use it within the command-line. There are several GUI tools out there to help you get started with git, but it can be extremely benef...
alright thanks, i will take a look. reading is sometimes difficult because of language barrier, but i shall try
also do most people use git command line, or gui?
personally i find gui easier because it shows easy to understand changes/differences
git reddit also has a lot of good resources https://www.reddit.com/r/git/
also do most people use git command line, or gui?
@heavy knot Doesn't matter, if you know the basics, the method used hardly matters
I prefer the cli
hmmm, maybe the os influences some people also i think so what they use?
i am windows so i use gui
Well OS hardly limits the tool available these days but yeah as a general rule windows users prefer GUI
looking for help with Odoo 12 tag me please
anyone know why my vim is like this?
Everything that doesn't have a text or spaces in it is black for some reason
guys i need to convert a .exe file to a .msi using python
anyone knows some possible solutions or packages that i can use for this?
not sure what this does tho
could someone please help me understand if this library is fine for converting .exe to a .msi file
from what I can read I think so
@drowsy lava i cannot see any docs for converting .exe to .msi
silent installation
i need to download and silent install exe files
but thats not possible unless its converted to a .msi
because i am trying to automate something
what would that be?
chill lol i need to make a script to run for setting up atom and vscode on many machines
dont wanna manually do it
and trying to improve my python
would you know any library to convert it to a .msi?
hmm....
It can help to create a .msi
but
you need to do it manually
with all those methods
i essentailly need a msi wrapper
ll what does you need to do it manually mean, write the code or...
you mean msi wrapper?
I have no idea what it means lol
the function FSI create
means
tells you
to create a new file called cabname with no extension
and then list all the files that you want in the msi
exactly
in a tuple
ok...
and everything in the tuple must be in the cabname file as well
and you'll make an msi installer I think
idk I'm in a rush but good luck
lmao no issues thanks for helping
@thorn berry what kind of systems are these?
Are you the sysadmin here?
Is it possible to have javascript autocompletions in pycharm community?
@thorn berry find a tool that creates msis instead of adding an exe
I'm sure windows gives sysadmins the tools to install things to all pcs they manage.
@sly sleet what is a msis?
*msi's
Only if you are a sysadmin
https://software.intel.com/content/www/us/en/develop/articles/windows_silent_installation_guide.html
Hello, can anyone help me how to get PyCharm (Windows 10) connected to WSL (this is easy) and VENV (don't know how). It is possible in VSCode, but I would be happy to make it work in PyCharm, 'cause it's awesome. 
@sly sleet any solution for silent install any .exe file if you're sysadmin?
bruh stop pinging me repeatedly
https://www.404techsupport.com/2008/12/23/using-group-policy-to-deploy-software-to-select-computers/
hi guys. What does STOP_PENDING mean when running sc query x on wiondows promt?
GPO installing rarely works
Hello, can anyone help me how to get PyCharm (Windows 10) connected to WSL (this is easy) and VENV (don't know how). It is possible in VSCode, but I would be happy to make it work in PyCharm, 'cause it's awesome.
@clever widget If anyone is interested: just create virtualenv usingvirtualenv -p python3.8 .env(not usingenv) and then set up Python interpreter as{project}/.venv/bin/python3.8. 👍
Is there a pay by which I can auto run a python script at start up in windows
Code suggestions starting to take a while in Visual Studio Code with ~400 line python code (basically no imports). Any way to improve the speed the suggestions come in?
It doesnt look like it's using significant ammount of CPU performance so assuming it's not slow due to computer not being able to handle it
it's probably firing up the pylance and scanning the code
I'm trying to make a dockerized Vue -> Flask & Flask-socketio server, but I'm running into an issue when I deploy it on Heroku.
End of my Dockerfile:
gunicorn -b 0.0.0.0:5000 app:app --daemon && \
sed -i -e 's/$PORT/'"$PORT"'/g' /etc/nginx/conf.d/default.conf && \
nginx -g 'daemon off;'```
I think the issue is I'm trying to start the eventlet server AND the flask/vue server in the same container.
Is there a way to properly do this?
Two different containers
Code suggestions starting to take a while in Visual Studio Code with ~400 line python code (basically no imports). Any way to improve the speed the suggestions come in?
@paper moss you get autocomplete in visual studio code???
yeah, kite for autocompletions @thorn berry and pylance for python language server. These are vscode extensions that you can install.
aah kite @leaden tartan but they barely give you any completions without buying pro oof
yeah the pro one basically writes your entire project but the free works okay too
i plan to avail their student pro offer once I get my college id
I ended up uninstalling because it was getting more in the way, than doing any good
its suggestions were no better than what my IDE already does
ehhh, to each their own ig.
for me vscode is way better than pycharm or vim since I know all the hot keys, and i dont want to switch to something new and have to reconfigure stuff just to get it working.
please don't compare sane IDE's to vim 🤣
im using VSCode and my Python lint (pylint + flake8) arent outputting anything in the "Problems" tab
i found this and i typed in python -m flake8 main.py
it shows what its supposed to show but the Problems tab is stil lempty
empty*
does anyone know how to solve this
I jest of course, it's basically just a really light VSC for me
@dusty maple yeah i use vim only when I need to quickly change part of my code, which can be done under 2 minutes. I love its search functionality. is very fast.
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
i plan to avail their student pro offer once I get my college id
@leaden tartan they have student offer?? hell yes I'm in
link pls
I can't find student plan page
@void cipher https://www.kite.com/pro/student/
you don't have to enter it
look at the instructions
you have to install it first i believe
idk just read the page
okk ty anw
Hello , does anyone have experience with hosting services using nsjail?
Ive been trying to deploy a service using nsjail , but each time I do so , and connect to the service with nc , I get , css [E][2020-09-30T11:18:25+0000][6] pid_t subproc::runChild(nsjconf_t*, int, int, int, int)():464 clone(flags=CLONE_NEWNS|CLONE_NEWCGROUP|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER|CLONE_NEWPID|CLONE_NEWNET|SIGCHLD) failed. You probably need root privileges if your system doesn't support CLONE_NEWUSER. Alternatively, you might want to recompile your kernel with support for namespaces or check the current value of the kernel.unprivileged_userns_clone sysctl: Operation not permitted
so for this , as suggested by google , I tried running sh RUN (echo 1 | tee /proc/sys/kernel/unprivileged_userns_clone) || (echo 'kernel.unprivileged_userns_clone=1' | tee /etc/sysctl.d/00-local-userns.conf) 2>&1 RUN service procps restart
but that doesnt work either
this is How Im invoking nsjail ,
#!/bin/bash
./nsjail \
-Ml --port 9000 \
--user nobody \
--group nogroup \
--max_conns_per_ip 5 \
--cwd /home/ctf \
-R /app -R /bin -R /lib -R /lib32 -R /lib64 \
--time_limit 30 \
--cgroup_cpu_ms_per_sec 100 \
--cgroup_pids_max 64 \
--cgroup_mem_max 67108864 \
-- $@```
You need to run NsJail as root
unprivileged_userns_clone is a debian-specific thing
If you happen to be running debian (on your host, NOT in the container), then you have to enable it on the host.
Otherwise, you have to run as root as Akarys said. To do that with docker, launch the container as --privileged
How do I package a python script as a dmg from a windows or Linux machine?
I thought I could use pyinstaller but that ended up not working
i hope this is the right channel, i'm trying to introduce python linting practice for my team, we mostly use intellij and want to have our github kick off the lint checks on every check in
can anybody recommend some tools to look at? in which linter.. which auto formatter for the team and ... where to go about enabling this linting integration?
so far i saw pylint, pyflake8 for linter and autopep8 black for formatter
quiet a choice here but does it really matter which tools? i just hope to use easiest and the most well supported one
@snow sparrow here's what I use: flake8 for linting and autopep8 for formatting. Flake8 since it combines the best practices from the other linters you mentioned. i don't use black because it is too opinionated (even though that might be considered a strength) and doesn't provide many configuration options.
If you use flake8 amd autopep8, you will find that vscode has excellent support for both of these (and others)
Alright
how to check in setup.py that a package is not installed and if it is installed uninstall it?
can anybody recommend some tools to look at? in which linter.. which auto formatter for the team and ... where to go about enabling this linting integration?
@snow sparrow I'd recommendblack... It is opinionated, but that's not a bad thing.
Just configure your IDEs to format on save, and never worry about it again.
It's getting very popular.
guys i need to interact with a shell script
i have to interact with it multiple times so Popen doesnt work well for me
pexpect is not working as expected lol
@leaden tartan @obtuse rapids sounds like choices to make here. 🤔
patryk is waaay more experienced than I am so there's that
could anyone here recommend tools setting up linting upon every github push?
@leaden tartan i've used both and always just liked what pycharm offered (flake8 i think)... hence asked 😉
could anyone here recommend tools setting up linting upon every github push?
@snow sparrow you should actually be pushing linted code to github. Lint the code locally and then add checks using github actions (or some other CI) if the code is linted.
If you want more control, you can go with autopep8 I think
I honestly don't care.... I just want it to be consistent.
yep autopep8 does it very easily especially if you configure your ide to do it
black gives me consistency, and I did have to get used to some things...
But it is a non-issue for me.
consistentcy across developers is key
None of the changes are so horrible, and I don't want to have to think about it haha.
i plan on making separate configuration file to exclude some rules and unify tools across developers
I use the airbnb eslint preset for JS with some minor tweaks, and black for python.
just yesterday i contributed to a project which uses tabs for indentation (!!!) and ended up ruining the entire repo on my remote. I had to make a new PR lol
anyone have CI lint integrated?
i have CI lint checking enabled
that's what I do too. Isn't that CI linting?
pytest --flake8
Oh... I never used that flag lol
it's a plugin called pytest-flake8. it's is a pypi package
Is there a equivilent to this in pipenv?
# requirements.txt
psycopg2; platform_system == "Windows"
psycopg2-binary; sys_platform == "linux"
Yes, for example psycopg2 = {version = "*", sys_platform = "== 'win32'"}
pytest --flake8
@leaden tartan this is only for test, right?
@leaden tartan what tools do u use for CI? there seems to be many options but i'm looking for optimal one to setup on Github
like is it right to set this up as part of your backend build server and trigger it from github?
tree: command not found
Istreenot included in Github Actions?
It is not included.
You can see a list of what's available here https://github.com/actions/virtual-environments#available-environments
Anything else you will need to install yourself
@leaden tartan this is only for test, right?
@snow sparrow this will runpytestandflake8at once
ok, so basically linting on test runs
i’m leaning towards just configuring pre commit hook rather than integration server linting after push
like is it right to set this up as part of your backend build server and trigger it from github?
@snow sparrow i dont understand what you mean but here's the thing. Even if you want to run linting on your project, do it before pushing it to your remote. As a general rule, you do not want CI to change your source code, just testing it on Ci Is enough
i’m leaning towards just configuring pre commit hook rather than integration server linting after push
@snow sparrow that's a great idea. Especially if you don't have a very large test suite. But problem with commit hooks is that they will only be present on your machine, not on others
linting isn’t formatting though, it’s just catching the syntax right? so CI won’t change it unless u put autopep8 or black in it
well we share repo so everyone will have their precommit hook setup?
exactly, and you don't want to do that
would have to push precommit hook i guess
hooks cannot be pushed I think
but I don't bother. If someone pushes unlinted code, their PR build automatically fails and they have to fix their code and correct their PR
their code, their problem
Are there any video classification tools? Like automatically getting data reports on appeared objects within videos/images?
hey everyone! im not sure if this is a good channel to ask in, but does anyone have some pointers for where to start with dockerizing my discord.py bot?
@snow sparrow Just commit the pre-commit.yml config file to git? I like using black and isort since they do automatic fixing on pre-commit. If your entire team has the same configuration, then that's a good thing. I don't see why it's bad for everyone to have the same hook if the purpose is making the entire repository legible.
@grave portal yes makes sense, looks like there is something called pre-commit package that helps with this - but i'm curious what how people like automatic formatting feature as versus just letting them know of linting errors so they can address it themselves.
Check out pydanny/cookiecutter-django and go to the dir that has those curly braces {} Edit: Oh I see. Misinterpreted.
I can see both sides of the aisle, but personally, at the end of the day, most devs are not going to remember to sort all imports correctly, make the lines 88 max chars and, if it's over, make sure the new line looks pretty formatted. I'd much rather just have the linters do that for me.
I agree.
Recently upgraded to poetry 1.1.0 and I was just curious about it, poetry-core, and tox
Currently I have tox configured to install testing deps for each environment separately, which allows for really fast parallel builds in Travis CI
Would there be any advantage to using poetry-core in terms of tox if I don't use poetry there in the first place aside from automatically managing the versions as well?
What is the best web-based IDE? It used to be Cloud9, but not since it was acquired by Amazon.
If someone is an ML engineer and uses MLOps, how do they monitor data drifts
drifts or monitor the quality of their models at work? What tools?
How can I configure a Pycharm run configuration to use the GCP functions-framework serverless functions thing. To run one from the command line, the command is just functions-framework --target=<whatever> - but I can't figure out how to turn that into a run configuration
Nevermind, can just set it up as a python module run configuration
hey so i'm trying to configure a background for atom
and i installed this package here: https://github.com/simon-xia/atom-global-background
my settings are as follows
sorry idk how to paste it in a plaintext format
however, as can be seen, the background hasn't changed
any help?
I've seen people in Youtube a while back using a vscode theme/font where self was italic. It looked really nice, but I can't remember the name. Does someone know the name?
It seems popular
I think I found it. It's just the font
They use it in this theme
Operator Mono
Nvm I don't want to buy a font
@obsidian grove here's an awesome looking font i use https://github.com/microsoft/cascadia-code/wiki/Installing-Cascadia-Code
microsoft >;((
has anyone found black to be less stable recently? I seem to be finding it formatting code and re-formatting for some reason
anyone can asnwer my question?
I know this is a pretty subjective question but I'm quite new to programming and i was wondering if i should VS or VS code, now I made my research and I am leaning towards VS, because it seems way more versatile but i was wondering what the user experience was, and how the visuals of it were, because VS code seems very modern and clean, and from their website VS looks quite a bit dated, so I guess i just wanted some opinions
feel free to ping me
thanks
@hollow ferry i stole this from another server
Visual Studio Code. You’ve probably heard of it, or even seen people in it, by why shouldn’t you use it?
In short: Visual Studio Code is a text editor. This is fine for languages like JS, TS, or Python, but if you want to do C# or C++, it’s heavily implored you look into Visual Studio. Visual Studio is a much larger install, so beware if you have limited disk space, or slow internet.
Furthermore: As Visual Studio Code (VSC) is just an enhanced text editor, you miss out on important features such as intellisense and memory profiling, which Visual Studio, an IDE offers out of the box. There exists extensions for VSC to make programming C# and C++ less painful, but at the end of the day, it’s not an IDE, and could hinder your workflow in the long run. VisualStudio is streamlined for C#, C++, and other .NET languages, and offers better tooling for such.
By no means do you need, VS, or an IDE in general, but an environment made for development makes life easier.
basically vscode for python js etc, but visual studio for c++
@leaden tartan well thank you very much for the information but if you don't mind i have a few more questions , from what i have seen VSC has intelisense too (for python at least), my next question is about user experience i guess, how comfortable is VS in comparison with VSC, because VS seems pretty outdated in terms of visuals, is there any way to change it, maybe it's already in the settings or it's a plugin of some sort, pretty much what I'm asking is how customizable it is, can i make it dark mode, can i change the font,can i change the color of the text highlighting and stuff, in essence can i have the features of VS but make it look more modern like VSC.
Imagine it like Chrome vs Some newer browser, now Chrome has all the features i could ever need but maybe doesn't look as good as the newer browser or it's not as user friendly, but in the case of Chrome it's heavily customizable and i can tailor it to my liking pretty much making the choice simple, because i get all the features and since it's very customizable i also get all the good features of the new browser, making Chrome the obvious choice.
Is VS like Chrome, or is it more restrictive in terms of customization?
okay thank you i have found a lot of resources and I can see that VS has a lot of customizing potential, also i wanted to ask how good the python integration is and if there is any downside to using VS over VSC for python specifically, lastly is using multiple coding interfaces (sorry if that's not the name) something people do, or something that is recommended, for example using VSC for Python JS and similar and using VS for C languages ?
yeah you can do that
i use vscode for everything but java and intellij for java
vscode c/c++ extension is decent
especially if you also add the llvm one
@hollow ferry
I haven't really used visual studio myself. My dad uses it sometimes and honestly the interface looks pretty old, but he doesn't care about visuals.
ah, who cares if the interface isn't super sleek
Like sure, VSC has that modern feel, but that's because it's all HTML and CSS which severely degrades performance
I wouldn't go as far as not call VSC an IDE, but it certainly has sort of an opt-in approach to features
Perhaps a bit ironic, you (practically) can't set a background image in VSC
Like sure, VSC has that modern feel, but that's because it's all HTML and CSS which severely degrades performance
@ebon escarp html css degrades performance?!?
I have about 30 extensions on vsc, and it still runs faster than pycharm while performing better and looking waay better
I'd set up pylint as a github action on a new repo, and it immedietely failed. The only thing on the repo was a bare django project. What should I be doing? (new to this stuff, trying github actions for the first time)
this is an issue of bare django, it's not pep8 compliant
a lot of lines are over 79 characters
especially the password hashers in settings.py
oh oof do i go through rewriting them to make them shorter?
some of them can't be rewritten
for example the password hasher classes are too long
so i add # noqa in front of them to disable linting for that particular line
a lot of lines are over 79 characters
I've got the line linting thingy off
My screen can fit like 300 characters and it's not like anyone else reads my code
idk man, that'd probably come back to bite you in the ass later
pep8 exists for a reason
Quoting from stack overflow
Much of the value of PEP-8 is to stop people arguing about inconsequential formatting rules, and get on with writing good, consistently formatted code. Sure, no one really thinks that 79 is optimal, but there's no obvious gain in changing it to 99 or 119 or whatever your preferred line length is. I think the choices are these: follow the rule and find a worthwhile cause to battle for, or provide some data that demonstrates how readability and productivity vary with line length. The latter would be extremely interesting, and would have a good chance of changing people's minds I think.
Since I code alone, this argument falls short
I agree with most of PEP-8
and definitely use it
but I also think that it shouldn't be followed blindly, but more as a guide line (unless your boss says differently ofc 🤣)
any idea what i can do about my issue?
@ebon escarp yeah since you code alone, it not an issue but when you start coding with a team you'll get a lot of weird looks
i don't get paid, but still follow it. A few of my public repos got Hacktoberfest contributions. I doubt anyone would have contributed if they saw the line length of 300 characters
A decent percentage of programmers code on laptops which wouldn't fit 300 characters in one line
@ebon escarp theres a extension for background img in vsc
so?
I did
you have to at least somewhat research this
yeah?
yeaaaaah???
I use VSC, I tried all the extensions
the thing is, whenever you update
it all resets
well
wide screen probably
ik, it sounds idiotic
small font maybe?
and hey, don't call it idiotic
Often there's not a good way to break up long lines, and it ends up looking super awkward
in particular when you need to indent the second one and then it visually looks like flow control
then dont write lines that are 150+ chars?
that's why 91 chars is a good idea
split it up into variables or something
Often there's not a good way to break up long lines
you're probably writing statements incorrectly then
what type of code are you writing where you cant break up lines
can you give an example?
