#tools-and-devops
1 messages · Page 46 of 1
my guess is python applications would trip them every time, python executables are pretty rare
going to do a fresh build of my app and i'll throw it on virustotal to see what it trips
could also be request endpoint as well
it should be fairly easy https://pyinstaller.readthedocs.io/en/stable/bootloader-building.html
whereever you are making request calls to
defender may not like you connecting to specific domain
download source from github, switch to master, run the ... ./waf distclean ... command and then install pyinstaller but not sure if you need a compiler
https://www.virustotal.com/gui/file/ae42f48957b77d2519f9c6bac359fd7002465fd1beed873f399c862e14fca638/detection from a fresh app with a bootloader I built when 3.6 came out
I've been using gitbash on my windows laptop (all my production code runs on a linux machine), but I feel like it's a bit messy and it doesn't support the Python console very well. However I'm not seeing any better alternatives online.
Also, a PyCharm question. What is it called when pycharm learns everything you have installed and regains the ability to do real time help?
Ah. I was trying to figure out how to force it to do that, since I'm using a remote interpreter and I installed some stuff from the terminal
But I decided to just update pycharm and now I assume it will redo that process when it comes back on.
There's a way to clear it's cache, which will cause it to re-generate that stuff
ctrl + shift + a and you can search for "cache"
This PyCharm update is taking a really long time.
placuszek, what URLs do you connect to?
I wouldn't worry about some obscure AVs
if it fixed the bigs ones like windows defender then I'd just go with it
hi i need help with gitlab cause i'm new to it
i made a merge request but I edited the wrong file, is there a way to add another file to the merge request and remove the wrong one?
Make another commit to the same branch.
Does anyone know about a tool to do pair programming online?
I'd like it to have a REPL shell
Visual studio and maybe visual studio code support this
I don't know about repl support
It's for a technical interview, normally we just give them a laptop with everything set up
kind of hard doing that online
I recall using something online for an interview once but don't remember the name
I can try to find it tomorrow and get back to you
I'd love that, I
It had voice support too iirc
I'm doing it on Monday
We have a virtual meetingroom he gets invited too, just need some type of software or website easy for him to use
If I can see the code live that's great, but him sharing the screen is also fine
I also remembered this
It used to be free once upon a time
Guess it isn't anymore
It was pretty basic at the time but allowed me to study with someone
Thanks.
It's something like that I want, wish it was free so I don't have to include other people into this process haha
any vs code users here?
yes
vscode won't provide auto completion when inside ""
any way to disable that?
Hello!
Homepage: http://leafo.net/lapis
Reference manual: http://leafo.net/lapis/reference.html
GitHub: https://github.com/leafo/lapis
Twitter: http://twitter.com/moonscript
Make sure to watch in high quality so you can read the text! Sorry, I'll increase the text size for my next v...
See that video?
What code editor is he using?
I see he is using vim, but it's weird because he uses it as well as a terminal
I'm very confused
I want to use the same thing he does because it looks reaaally comfortable
he runs the gvim command and the editor opens, so I'm guessing it's a distribution of vim
vim is heavily customisable through plugins and configuration, gvim turns vim into a graphical application and adds some menus, I hear it has worse terminal support than vim.
@deep fern The service I was originally thinking of is Skype Interviews. Unfortunately, it has been discontinued. Hope the other site I linked will work out for you.
Thanks @tawny temple !
how to use jupyter
I've seen a few articles on people running Jupyter inside Docker containers. I had a few questions:
- What's the point of doing this when
condaalready comes with envs? - It seems like you can only have one env per container (maybe by design?) Any package installation is not persisted when the container goes down (maybe also by design?) Doesn't this make the setup a lot less flexible?
Docker ensures a consistent environment, which may be beneficial for some packages that have different behaviours depending on the platform
You can install packages in the Docker file, which will persist.
You can also set up a volume so that any future installed packages will persist
You can easily revert to the initial state by recreating the container from the image, which may or may not be useful to you
You could have as many environments as you want in it and choose which to activate
But these don't seem like particularly compelling benefits in the context of jupyter
So I agree that a conda env is generally adequate
It might help if there are some things that would otherwise be complicated to manually set up
Cause, assuming you already have Docker, all you need to do is pull an image and start it. No extra setup.
How do i limit line length to 79 characters in Pycharm as mentioned in pep8?
ctrl + shift + a and search for "margin" or "column"; it should take you to the right setting to change it
You can add a visual guide and enable hard wrapping
i did it , it only shows a line but it doesn't stop me from crossing the line
Search for "wrap", there may be a wrap as you type setting IIRC
I don't really recommend that though. I just use the line and manually wrap things cause I do a nicer job than PyCharm usually does (according to my tastes, anyway)
@tawny temple How do you persist installed packages? It seems like all packages are installed to /opt/conda, but when I mount that as a volume my container wont start because it can't find jupyter
Also on the note of conda, you can freeze env to env.yml then reload when necessary. Isn't this the same thing as extending a docker image? Is it that much "easier/better" to deploy docker over creating new conda envs?
re: docker
FROM continuumio/miniconda3
WORKDIR /app
COPY jupyterlab_env.yml .
RUN conda env update -f jupyterlab_env.yml
SHELL ["conda", "run", "-n", "base", "/bin/bash", "-c"]
ENTRYPOINT ["jupyter", "lab", "--ip=0.0.0.0", "--no-browser", "--port=8000", "--allow-root"]
jupyterlab:
build: jupyterlab/.
ports:
- 9001:8000
volumes:
- ~/dockertest/app:/app
- ~/dockertest/opt/conda:/opt/conda # <-- does not run unless commented out
I haven't tried freezing in conda. Is it slow to revert? Maybe not, since everything is presumably cached. But I assume it still has to spend time uninstalling/re-installing things. Re-creating a container on the other hand is very quick.
Conda is probably more approachable and user friendly. Docker requires an extra set of skills. But if you already know it for other reasons, then it's a more attractive option.
I had a look at some of the jupyter images here https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html
There are some that have R, Julia compiler, Apache Spark. I don't think these can be installed with conda, can they?
Regardless, they may be seen as more convenient since you don't even need to set up a conda environment in the first place - the image already has one with some fundamental dependencies
As for that volume issue, I am not sure. I can look into it.
I think you can conda install specific kernels, e.g: https://anaconda.org/conda-forge/julia
But I usually set them up as separate envs (e.g. Python Env, Julia Env, etc...)
I can see docker being useful in the case where you want to spin up a fixed image for many users (e.g. deploy notebooks to a large org, or deploy a trained model into prod). Some of the Docker Discord people said they try to avoid conda as much as possible though. Trying to see if I'm missing anything...
It depends on the context. If I was trying to build a container to host a website, i wouldn't install stuff through conda cause it will just make my image larger compared to using pip. Maybe that's what they meant.
Okay, so functionally it's the same, but there may be side effects of conda that can be avoided, like larger image sizes
Yeah, and that may matter if you're deploying an app to production
Not so much if you wanna give people an environment to program in
I haven't used conda in docker like that so I don't know what it pitfalls would be
You should ask those people why to avoid conda
It could also make images take longer to build, not sure. Depends on what you're installing with conda.
Cause you can just get base images with python, r, julia, etc. which save you having to install or build them yourself
The issue with the mount is that the host's directory takes priority over the container's
So it "wipes" the directory in the container
I'm not sure what the workaround is, cause you cannot make changes to a volume inside the dockerfile either - those changes will be discarded
You may need to configure conda to install new packages to your volume somehow
But also be able to read from the original directory
Is that effectively bind mount?
I don't think it has to be a bind mount
Maybe the issue I described is only with bind mounts
Maybe I'm misunderstanding how docker works
My understanding is that:
~/dockertest/opt/conda:/opt/conda means "take the container /opt/conda and put it at the host's ~/dockertest/opt/conda"
When I debug the container with that mapping, it successfully pulls the image and runs the update. But it fails when it gets to the entrypoint because it can't find the jupyter executable.
My interpretation of that effect is that:
condais (or at least was) installed, but- Enabling that mapping breaks a path / deletes something?
No, it's the other way around. The host's directory gets mounted over the container's directory.
Since the host's directory is empty, you end up mounting an empty directory in place of the /opt/conda dir in the container, thus overwriting all those files previously there.
You can try using a normal volume instead of a bind mount
But why can I run conda update but not jupyter notebook?
Using which conda and which jupyter shows they're both installed in /opt/conda
I think I'm using normal volumes right now:
version: '3'
services:
jupyterlab:
build: jupyterlab/.
ports:
- 9001:8000
volumes:
- ~/dockertest/app:/app
# - ~/dockertest/opt/conda:/opt/conda
If you mean in the dockerfile, then it works cause the volume hasn't been mounted yet
(i.e. not mounted while the image is being built)
yeah, I run the command in the dockerfile
oh I see, because the image is being built
Alright, so that's the reason.
ahh okay that makes sense
Normal volumes should work
It says the container's contents will be copied to the volume
Well now I'm confused again lol
So the results of /opt/conda get copied to host's ~dockertest/opt/conda?
If that's the case, then it should be able to find jupyter, no? Unless that copy causes some path to break?
You are using a bind mount, so nothing gets copied.
If you use a normal volume, then docker will copy.
is the default volumes mapping a bind mount? Do I need to specifically declare a volume mount?
In your docker compose, you need to define a volume, and then instead of a host path left of the colon, you specify the volume name
Hold on, i think the docs had an example
I thought this was the syntax for volume mount:
volumes:
- ~/dockertest/app:/app
version: "3.8"
services:
db:
image: db
volumes:
- data-volume:/var/lib/db
backup:
image: backup-service
volumes:
- data-volume:/var/lib/backup/data
volumes:
data-volume:
See at the bottom, they declared a volume
Then they used its name instead of a host path when defining the volume for the backup service
Volumes just support more features than bind mounts
I don't know the technical reasons for why
It seems to persist everything, even notebook state
Okay, so it seems like rule of thumb will now be to not map directly to the host machine, but rather to named volumes
Thanks @tawny temple
You're welcome
be sparing in volume mounts, they should be something you do after every other option isn't feasible, not a starting place. Unless your app has massive massive site packages or you want run sooooo many containers that space to hold your containers would be overwhelmed, site packages should be left in container
conda is likely not used with python docker because docker already provides some of features that conda provides. you specify in Docker what version of python you want, each container can have it's own, same with packages, packages installed into one docker container are not provided to another
@wooden ibex How would you handle the use case of a central Jupyter server with multiple client notebook environments? Each user needs their own environment, and it seems impractical to force the user to reinstall their set of packages every time their container goes down. Does each user orchestrate their own environment?
Also, not clear why volume mounting is bad?
because container isn't portable
it's tied to the host
sure, network and all that but it becomes yet another thing to deal with
The way to make it completely in the container seems to be to not mount /opt/conda and instead pre-load all packages at start.
- Portability
- Convenience
That seems to be the main tradeoff?
I'm not 100% familiar with Jupyter and like
is it that you don't want switch containers when you want different version?
volumes are fine
Yes, I agree that it is mainly advantageous when all the packages you need are installed in the dockerfile rather than later when running the container.
just make sure it's not first approach to docker and something you do after you are like, yea, nothing else works, volumes it is
Yeah, the pure docker form, you have to switch ip/port to get to the new env. You also have to take down the container, update the compose, then bring the container back up to "persist" an installed package
I guess for an experimental setting, mounting the volume makes more sense. Closer to prod, keeping it in the container makes it more portable
volumes make sense for stuff like config files, sometimes and database (I actually dislike docker for running databases)
I've also heard you're not supposed to put the DB in Docker. Is it for the same reason? The data won't persist unless it's mounted as a volume?
data will persist in container
Even if you restart the container?
it just locked to that container so when you go to upgrade your database container by pulling a new container, data will be locked inside the container
yes
data written inside a container remains until container is destroyed
is it destroyed with docker-compose down or server reboot?
it is docker-compose down, no to server reboot
Yes, it is destroyed when you do down
yea, I had to RTFM
I had the pleasure of making that mistake myself to learn 🙂
But I didn't care for the data so whatever
yea, all my containers don't hold data beyond cache data I don't care about
I have devops python container with SQLite database holding some cache copies of database, on app start, I destroy SQLite file
so I wouldn't care if container got destroyed
How do you run your dbs
You said you don't use containers
Just install them on the host normally?
we are all Azure so all our DBs are PaaS
either MSSQL, one Postgres and some CosmosDB
I see. I never used paas
wait, there is that one VM with MSSQL installed
I dislike that VM
at certain point, it's soooo awesome
PostGres server I never have to care about, yes please
Its not in win32 api for some reason
Probably have to use ctypes
but this isn't really the channel for this, #❓|how-to-get-help
we don't have a windows channel anymore
@heavy knot Can your systemd containers do this? https://github.com/sickcodes/Docker-OSX
Not familiar with systemd containers, though.
Didn't know they even existed.
Oh chroot.
It's not a chroot anymore
systemd-nspawn is a container
It is very similar to docker in some regards, but much better integrated with systemd, obviously
And it was developed by our lord and saviour Lenart Poettering
@maiden nova I'd use kvm for that tbh
And it was developed by our lord and saviour Lenart Poettering
@heavy knot Hadn't heard of him before...
It is very similar to docker in some regards, but much better integrated with systemd, obviously
@heavy knot What benefits does that give?
It gives us the benefit that's faster
better
stronger
If you're running on a GNU/Linux system with systemd
some people dislike it, but I'm a Poettering fangirl
His software is great!
Ubuntu - so yes.
But what are the benefits for the containers - not the host?
Over Docker.
It can provide better separation and security according to the docs
if I'm not mistaken you can use it along side SELinux or AppArmor
Right - though I'm sure Docker has similar features.
What about a docker-compose alternative?
Or Dockerfile?
What's the equivalent for systemd?
depends
usually a unit file that descibes the service and container env
and you could script it with python or shell
docker-compose is written in python, I'm pretty sure similar tools exist for systemd-nspawn
Can you give me an example of the format?
Those should answer that question
nspawn has it's own config file format as well
Ah yes, I've seen them before. It doesn't look nearly as powerful as the docker config files (particularly docker-compose). Also systemd seems to be missing the throng of pre-built images that Docker has. I couldn't find an equivalent to https://hub.docker.com/ for systemd. Does one even exist?
You can easily build stuff yourself
You just install what you need into a it's own folder and have nspawn run it
That sounds very tedious compared with using prebuilt images.
you can orcestrate with any tool that orchestrates linux systems
eg ansible
or chef or puppet
it's a matter of taste
ansible could replace docker-compose for you
another option for containers is kubernetes it supports a bunch of backends, also docker
hello i have an erro when i try to import pil module which i have already downlaoded
and i get this
No module named 'PIL'
if someone could help me i would be very grateful
docker attractiveness is ecosystem around it, same reason python is so popular
dockerfiles, prebuilt images, docker-compose and kubernetes is what drives docker popularity
Can someone help me get kite working with Spyder?
Hello everybody! I am completely new to python and I need help please. PIL can make the y axis go up rather than down?
Hey, in visual code the relative path is based on the current opened folder?
Anyone know how to fix sublime asking if I want to reload a file that has changed on disk? My configuration is apparently correct yet it still happens. I am editing over a CIFS mounted SMB share if that is of any significance.
{
"always_prompt_for_file_reload": false,
"color_scheme": "Packages/Theme - Darkmatter/Darkmatter.tmTheme",
"dictionary": "Packages/Language - English/en_GB.dic",
"font_size": 8,
"ignoreChanged": true,
"ignore_changed": true,
"ignored_packages": [],
"preview_on_click": false,
"theme": "Darkmatter.sublime-theme",
"translate_tabs_to_spaces": true
}
Hello anyone experienced with postgresql+django with docker volume?
I wish i knew django
The Internet means you can turn that wish into a reality
it truly is magical on the internet
i am trying to run my discord bot in a docker container
and i am very out of my element
i get this error when i do so
it works locally
this is the dockerfile
# For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3.8-slim-buster
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE 1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED 1
# Install pip requirements
ADD requirements.txt .
RUN python -m pip install -r requirements.txt
WORKDIR /app
ADD . /app
# Switching to a non-root user, please refer to https://aka.ms/vscode-docker-python-user-rights
RUN useradd appuser && chown -R appuser /app
USER appuser
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
CMD ["python", "bot/__main__.py"]
i think it has something to do with my workdir?
this is the project structure
and it fails on this line
You could try putting on line 6 of the file that fails
import sys
print(sys.path)
hmm thats a good idea, ill try that
May not be the issue but Docker's ADD is known to do some magic. I usually use copy to avoid issues
i originally did this becuase the linter shouted at me
BUT either way works fine locally
if i remove bot. it works in docker
so i guess my new question is how do i make VSCode accept that import and not be annoying with the warning
Yeah so it looks like what's happening is that locally, you have your current directory on the python path, and in docker you do not. Try adding print(os.getcwd()) locally and in Docker and you'll see what I mean
The easiest answer is to move your main script outside of your package
so you have a main.py at the top level that imports items from bot
Or you could install your package (as a module or a command) and use it that way
That's what I typically do, so that you don't have to install your module to run it.
id prefer if i could keep the __main__ file in the bot package tho
as moving it requires some other changes
is there a way to change the vscode linter to not bug me
If that's how you'd like it organized you should run your code with python -m bot
but like I said, I'm pretty sure you have to install it for that to work.
install what exactly?
Your module needs to become a package.
the __main__ module?
No the whole package, all of bot
isnt it already a package?
No, it's a module
ohh i thought folders were packages
I stand corrected, your folder structure is a package
but it is not installable
Did you try using python -m bot?
trying now
you could write up a basic setup.py, and pip install it.
when yall say install do you mean the whole bot?
Correct @barren spoke but I actually think it's not necessary. You can run a package without installing it.
cuz currently im working on CD for an amazon aws EC2 instance
push to repo, then the ec2 instance pulls the repo and builds the image and runs it
or at least thats the idea
you can, of course. but then you're beholden to the namespace/syspath of how you python -m.
Right but from above the context is that of a Docker container so that shouldn't be a problem
yee this is docker
# For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3.8-slim-buster
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE 1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED 1
# Install pip requirements
ADD requirements.txt .
RUN python -m pip install -r requirements.txt
WORKDIR /app
ADD . /app
# Switching to a non-root user, please refer to https://aka.ms/vscode-docker-python-user-rights
RUN useradd appuser && chown -R appuser /app
USER appuser
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
CMD ["python", "bot/__main__.py"]
current docker file
well cmd is wrong
i made it the -m on aws
I'll just say when I write python dockerfiles I do so very differently. I use a virtual environment, I use a multi-stage build to keep out unecessary components and I have a top-level project script instead of putting my script in package/__main__.py
That being said, I think just changing your CMD to run it as -m will fix your problem.
ya i have a venv as well
one sec let me put the updated version
ohh fuck i fixed it somehow
i think it was the package run that fixed it
lol perfect, that's the best way to fix something
i guess i need to reevaluate if i wnat to have to put bot. everywhere
is there a best practice for that
J why requirements for workdir?
Honeslty cuz it was in the example and i didn’t mess with it
is there a way to make pycharm auto-fix issues like these?
./main.py:70:66: E127 continuation line over-indented for visual indent
./main.py:75:1: W391 blank line at end of file
./cogs/entrancegate.py:34:53: E128 continuation line under-indented for visual indent
./cogs/entrancegate.py:34:128: E501 line too long (241 > 127 characters)
./cogs/entrancegate.py:44:128: E501 line too long (242 > 127 characters)
./cogs/entrancegate.py:58:128: E501 line too long (259 > 127 characters)
./cogs/entrancegate.py:78:128: E501 line too long (237 > 127 characters)
./cogs/triggers.py:5:1: F401 're' imported but unused
./cogs/triggers.py:36:1: E303 too many blank lines (3)
./cogs/games.py:43:35: E701 multiple statements on one line (colon)
./cogs/games.py:80:41: E701 multiple statements on one line (colon)
./cogs/games.py:89:26: E701 multiple statements on one line (colon)
./cogs/games.py:92:24: E701 multiple statements on one line (colon)
./cogs/games.py:93:25: E701 multiple statements on one line (colon
i'm assuming they're all pep8
(@ me)
i know.
i'm asking if pycharm can auto-format to fix those
cuz it misses some things that flake8 catches
how can i persist a sqlite db with docker?
i have found volumes
and that seems to be the way to go
but how to use them is eluding me
docker run -v ~/database:/app/bot f7676b536427
this is what im kinda trying and its not wanting to wokr
Pycharm should deal with all of those except multiple statements on one line with its reformat options
Well, depends on how those statements look but you shouldn't write that in the first place
Absolute paths in the container?
If i do /app it says it can’t find main hmm
Cuz I’m running the bot package with -m
J, I'm talking in general
~/database <--- bad, doesn't matter host/container
in container, I'd move database into something no where you place python file
like put python app into /app on container and /database which is volume mount point
or /app/database is fine but make sure nothing goes in there but sqlite file
is mypy not capable of understanding this??
try:
import ujson as json
except ImportError:
import json```
```sh
mypy test.py
test.py:4: error: Name 'json' already defined (by an import)
Found 1 error in 1 file (checked 1 source file)```
Its not my code, but why is mypy returning an error here? Its obviously not a redefinition. Could this be a bug?
Found an issue, not resolved since 2016 https://github.com/python/mypy/issues/1153
What exactly is app in docker
Cuz it there but i never really understood what it means
Is /app where docker puts my program?
My project structure is ClemBot/bot/
So would a relative path to the main be /app/ClemBot/bot ?
@wooden ibex This is commonly seen in librairies that need to support different versions of python
I'm trying to understand how the perpetual fallback license works for PyCharm. Is there any kind of penalty to prevent you from having a month-to-month subscription, but cancelling each time and renewing every time there's a release that you want?
Other than the fact that you only get the PFL if you pay for a whole year up front or pay for 12 consecutive months.
hmm i tried using relative paths and docker shouted at me
See 'docker run --help'.```
ok im doing this now
and it runs but it wont create the sqlite file
i have this at root
and i wnat to have the bot write to database
this is the structure i have in the Clembot folder
applications running in docker can't directly access your drive
oh wait that's a bind mount I'm blind
J and it's not working?
@J it's not something I can easily solve, didn't look at docker in a while. But you may find this reference page helpful https://docs.docker.com/storage/volumes/
isn't -v volumes
yep, the way it's used here is a bind mount if I'm not mistaken
yep, you are right
I hate both and don't use either so I'm going off old memory when dealing with docker and volumes/bind mounts
I just stopped doing things that require file storage
databases go into cloud databases, files go into S3
stumbled into a nasty bug that caused my db to corrupt
it was an issue with some volume driver, took me ages to even figure out the cause
yea, I strongly dislike databases in docker, like this is bad idea, please stop
sure but whole point of containers was "This is disposable cattle" and database servers are rarely cattle
I see docker as a tool to spin up local test environments
and when it works it makes deployment a bit easier, but then there's other tools that are better for production
I use it for Prod and it works great but again, my database is Azure CosmosDB and few files are stored on Blob Storage
so containers themselves are stateless
Hey, Im trying to edit my xterm window but I cant get the font to change from the default, also it appears that whatever I merge stays in the xrdb, even if I delete that line in the Xresources, how can I change that
Reinstall 😄
Wym you can't select anything?
I can't click run without debugging
What type project do I need to do to make plain python file on vs
Looks like you have nothing to debug..
Idk what to tell ya man. Idk what that problem is.
Is that pycharm or something?
Whenever I start my program I must press key 2 times for it to print what I say. Help
Could someone help me with this?
https://stackoverflow.com/questions/62294174/pylint-shows-import-error-with-directories-inside-the-working-directory
It's odd that the imports are actually correct. Not really familiar with pylint, but I have a general suggestion. pylint may be getting tripped up because of the current working directory used when running the linter. Cause pylint is using a wrong directory, it may not realise/see the "bot" package.
Also, I disagree with the comment that states using relative imports is the "python way". Absolute imports are totally fine.
You could also look through the issues to see if it's just a bug https://github.com/PyCQA/pylint/issues
Opinions on Notion as a collaboration / organizational tool for coding?
https://www.notion.so/
maybe you put the host you're connecting to in the wrong field in putty?
what do you mean "direct filename"?
it looks like you're trying to connect to a server called "C"
can anyone help me with gits and commits
Now I'm using plugin called Git history diff to see my changes in commit
but i wanna delete this plugin/extention in vscode and code in git
and I don't know what is this command
I have tried "git diff" to see but it only shows the changes between two commits
And I'm not that comfotable with it
Any idea ?
if found anything just easily ping me
Dead, you can't easily, that's whole point of git
@stiff burrow
you can delete history extension in VSCode but git stores history, it's not adding anything to git it's not doing naturally
I have a docker container which is running with the root user. How can I change it to run with a different user without recreating a new container (just want to modify the existing one)
I always find answers related to using docker run but as per my understanding that will create a new container and start it
docker container need privileges to run in different context, namespaces and so
so you may have to do a lot of things to run as a regular user, and more, give this regular user so much rights that it'll be the same problem as running as root
@quiet copper probably new container, containers should be disposable anyways
uh... when i move like a project and open it with pycharm... how does one easily get all of fthe modules?
since it uses a venv?
Requirements file
Does anybody happen to have experience with GCP metrics and alerts? I'm trying to create an alert policy and I have trouble interpreting what a particular trigger condition means.
I'm able to create a policy with a condition like "If a particular time series increases by X % for Y duration", and I'm just not sure I understand what that means. Would that imply that it triggers if the value increases by X % in a given Y period relative to the previous Y period?
I found this blog post implying my assumption might be correct, but it's 5 years old and the interface and wording used in the UI is different now, so I'm not sure: https://cloudplatform.googleblog.com/2015/10/alerting-on-a-metrics-rate-of-change.html
Hi everyone. I have a OOM problem with k8s and python. I have 3 k8s nodes (the master and 2 workers). The principal node has 32GB of RAM while the workers have 700GB (in total). I have deployed an application written in Python with memory limit/request (2gb limit and 1gb request). The problem is that the containers that are running on the workers are constantly going in OOM and they are restarded (10 times per day) by k8s while the one on the smaller node is working perfectly. Has anyone ever seen something like this? Any idea? Thanks!
Hey guys idk if anyone has experience with Sublime Text but I was running a program and sublime text and the plugin host process start to eat up almost 100% cpu and the fans on my laptop started going crazy. I'm not sure what the problem is. The plugins I have installed are:
i posted this in a diff server and didnt get a response so ill repost here
i have very little docker experience so im sure its a very simple problem
I won't be able to help much but it'll probably be better if you just copied the message
is it not legible to yall?
images aren't exactly friendly because they need to be opened which limits writing and suck on phones
Try using an absolute path instead of a relative one
Our use a normal volume instead of a bind mount if you don't really care where the volume is on the host
i tried both of those
it ended up being a permission error on both a volume or a mount
so i cheated and ran it as root
not the best practice but im fed up with it atm 😁
So i did this post because i have a problem , since 2 days i tried to install discord.py and i use all the command to install it but my code don't execute.
Traceback (most recent call last):
File "c:/Users/Cyril/Desktop/@Dev/pyDiscord/main.py", line 1, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
I tried to install all the requirement and they are allinstall when i try all the command like : pip install discord.py or python -m pip install discord.py it send me thsi message for different things but the start of all the output are : Requirement already satisfied:
PS : My IDE is Visual Studio Code and my PIP is on the last version ( 20.1.1 ) and my python is on the version 3.8.3, i check with command : pip --version and python
Thanks for your help
And i try to install without VSC and with VSC
have a look at the
bottom left corner
of vsc
should show what version its using
hmm ok must be another issue
@earnest crescent in a terminal, type py -0 to see all versions of Python you have installed. the 32-bit in your VSCode interpreter makes me think that might be an issue.
Installed Pythons found by C:\WINDOWS\py.exe Launcher for Windows
-3.8-64 *
-3.8-32
yep. so, change the interpreter that VSCode is using to the 64-bit version. if you don't absolutely need it, i would also uninstall the 32-bit version.
Ok , what command i need to do ?
for changing the version in VSCode, just click on that area that you took the screenshot of. it will then have a drop-down at the top to select the version.
for uninstalling the 32-bit version, same as any other program uninstall.
yep. should work now.
Ty very much !!!
yw!
setting up sublime text for python, any package reccomendations?
👍 Thanks :D
Anyone know why my sidebar would have disappeared after closing and opening?
I opened the same folder, but the side bar never showed up.
It opens the side bar if a directory is opened, but not if a file is opened.
If you press ctrl k + ctrl +b then it will always keep it open
Got it 😃
My Goal is to create a python program using selenium which will do certain automated task like taking the input from a text file, and fill up a php form online using the data on the text file, using headless chrome,etc.
I will be hosting this python program on my linux vps.
And, I want to create a php account registeration page, so every new user who will register will get a different account,
and there he have to fill certain data like name,number,address which will be saved in a text file.
and will trigger the python script to run on clicking the submit button.My Doubt it If two or more user are accessing their account, filled the data, and clicked on submit button.
Does this will create python program instances for each of them or same python program will run for all of them ?If same program will run then, the python program will do 1 work at a time thus the process of other users will halt.
It's basically saying that the repo on GitHub is more recently modified than your local one
So it doesn't really want to upload the changes because as far as it can tell the GitHub one is the newer version
It's basically saying that the repo on GitHub is more recently modified than your local one
@graceful patio You are reading from #user-interfaces, right?
Yep :D
:D
I'm setting up the github repo for the "DrawfFortressStyleGeographyToAscii" project
Ahh :D
I was having a look at mapping sources for that
My working title has been term-gjs
Gis
So I think it's pretty simple cause you encounter it often
I think you could just modify the local files again then git pull maybe?
Or manually upload the current files to GitHub, then clone the repo to local which is what I normally do
I would fix it with git fetch origin; git rebase origin/master
That will pull the remote changes then apply your local changes on top.
I would fix it with
git fetch origin; git rebase origin/master
@tawny temple That fixed it! (im not exactly sure how.., but it did)
😄
Did my explanation not make sense?
As seagull wrote, the problem was that your local branch was out of sync with the remote. So locally you had some commits that the remote was missing, and the remote had some commits that you were missing.
Think of a rebase like this: it temporarily stashes away your commits, then pulls the commits from the remote, then takes your local commits out of the stash and re-applies them on top of what you just pulled.
I don't know if it actually uses a stash (there's literally a git feature named that), but that's not relevant to the point
Ah, that makes sense 👍 thanks :D
No. What this question implies is that the commits have other changes that they don't want to pull. They only want to pull that one file's changes.
I don't think that's possible, but maybe it is with some trickery. I don't feel like git is really designed that way though.
If all the file's changes are within one commit, then it is possible to like rebase and drop other commits (or the same thing in some simpler way)
Ah, okay
Either way, you're basically breaking the history by doing this
About rebasing, I looked at something that was about the rebasing workflow. So, while on one branch they did git rebase master which moved all of there changes up to where the newer commits had been made and then switched to the master branch and did git rebase feature which took all of the commits on that branch and moved them to the master branch, am I understanding that right?
Yes, but you need to be careful about rebasing to master
If the branch you're rebasing isn't up to date with master already (which is what the first rebase did), then the commits will be placed somewhere in between master's commits. This is a problem cause it will re-write the history.
Which isn't something you want to do on master cause that's like the main branch everyone uses
Of course, git will prevent you from pushing if this happens. You'd have to force a push with git push -f
The reason that they would have done git rebase master was so that when they did the git rebase feature everything could be "in line", so it was:
Instead of:
Ah, sorry have to look at what you wrote
If the branch you're rebasing isn't up to date with master already (which is what the first rebase did), then the commits will be placed somewhere in between master's commits. This is a problem cause it will re-write the history.
@tawny temple Ah, thanks that was my main question
Actually, that may be a bit confusing
Yeah, I wasn't sure how git rebase feature would add the commits, while git rebase master just moved them up
Doing a merge instead of a rebase also places the commits in-between (i.e. in sequential order), but it doesn't rewrite the history. Instead, it adds a merge commit which is at the top i.e. the HEAD
With a rebase, the commits that are applied after have different hashes than their original counterparts. Hence re-written history. Hope that isn't too confusing
Like lets say master has A B C D commits, and feature has 1 2 as commits. Feature only has A B from master, so when you do git rebase feature, you will get A B 1 2 C D, and C D will have different hashes.
I don't think I know what hashes mean in this scenario
It's the ID of the commit. I'm just trying to say that as far as git is concerned, they are different commits than the original C and D
Why does the ID change?
Also, I was wondering how the example from above would with merging? Are there the same caveats?
Where you have to worry about "re-writing" history in a sense because now commits are "being added to history"
I'm not sure I really know. I'm not well versed on the innards of git. Maybe a simple explanation is that when you rebase, it could possibly change the diffs of the commits applied on top. So, even if it doesn't change their diffs, they still get new IDs. But I think this is something someone else will have to answer for you.
Merging doesn't ever re-write history.
Instead, it creates a new "merge commit" which is meant to reconcile any conflicts between the two branches.
Where as in a rebase, the reconciliation would be done in the commits themselves rather than in a new commit. This is what i meant by "rebase could possible change the diffs"
So, for the example above:
If the master has A B C D , and feature has 1 2 which only has A B, then when you merge, what would happen?
Okay, let me make some pictures and check to see if I understand
So, saying that we start with this:
A merge - git merge feature, will turn it into this:
Where, as a rebase - git rebase feature - will turn it into this:
I think that is the easier bits?
And then, now if we look at where the person developing the branch does not up to date with the master
I'm hesitant to comment on those graphs cause I am not sure how to properly interpret them
Would it be better if I explained the meaning of the circles and such?
Your rebase image has two extra circles. Not sure where those commits came from
If we're assuming the same commits on both the merge and rebase (excluding the merge commit)
Ah, I from the video I had seen, they said that a rebase "shifted the commits to the master branch"
Maybe the images here will explain it better https://git-scm.com/book/en/v2/Git-Branching-Rebasing
Might be even better to start here
Cause the first link is mainly about rebasing, not merging
Alternatively, you could just create a repo locally to play around with. Create some branches and some commits in each, then try to merge or rebase them and observe the logs
Ah, will do, those look helpful
This is another decent resource https://www.atlassian.com/git/tutorials/merging-vs-rebasing
Compare git rebase with the related git merge command and identify all of the potential opportunities to incorporate rebasing into the typical Git workflow
Good reads
For the question about why the ids were different:
This moves the entire feature branch to begin on the tip of the master branch, effectively incorporating all of the new commits in master. But, instead of using a merge commit, rebasing re-writes the project history by creating brand new commits for each commit in the original branch.
So, assuming that the "original" branch is the feature branch, it moves all of them by re-writing the commits rather than moving them, I think
BTW, it depends on organization what people use
my company, if you have pushed your branch, you must merge
I think I get the advantages of rebasing now: when you do it, your branch just get's slid up to where the master branch currently is, meaning that you don't keep needing merge commits in order to keep up with the master branch, you can just keep "moving up the tree"
downside is you lose history
I still don't really get that part, what history do you lose?
Ah, so the history where you can actually see the branch, and what was being developed on the main branch/other branches while that happened
Do you mean you lose the history for the merge commit, so you can't see what exactly needed to be done to resolve conflicts?
Cause otherwise IDK what you mean by losing history
When i think of losing history I think of squashing typically
Hey I'm looking into Fabric to automate server deployment
Looking at old docs I see that you could set host lists e.g groups of hosts. http://www.fabfile.org/upgrading.html#host-list
creating explicit fabric.connection.Connection and/or fabric.group.Group objects as needed; core Fabric is in the process of building convenience helpers on top of this
Any idea if these helpers have ever come to fruition?
Hey guys, I'm using a Digital Ocean droplet for a project. Whenever I try to apply cloud firewall rules to the droplet, suddenly CPU spikes to 80%, and internet connections to and from the droplet cut out intermittently. The droplet image is ubuntu-docker, and I'm only applying basic firewall rules such as allowing inbound SSH, and allowing all TCP/UDP outbound connections. Any ideas on what's causing this?
My guess is that the cloud firewall is somehow screwing up docker, since docker can normally bypass UFW, but probably not the cloud firewall. However, I don't know for sure, and even if this is the problem, I don't know the solution.
Hello guys
unless the question is about a "tool" like git or something, in which case here is fine
Hey @naive torrent!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
Anyone know of a package for sublime text that will basically just show if a file has not been committed yet?
Maybe the file looks like this if it has been committed:
And like this if it hasn't:
That's not the best picture, but something like that.
Ah, it seems that that is actually built in :D
I’m having something of a devops issue with tox. Here is my tox.ini
envlist = py37, py7-integ
skipsdist = True
[testenv:py37]
install_command = pip install {opts} {packages}
deps =
-rrequirements.txt
setenv =
PYTHONPATH=.
GOOGLE_APPLICATION_CREDENTIALS=test.json
commands =
pip3 install dash[testing]
pytest --driver Chrome --cov=dash_app tests/
[testenv:py37-integ]
install_command = pip install {opts} {packages}
deps =
-rrequirements.txt
passenv = *
setenv =
PYTHONPATH=.
GOOGLE_APPLICATION_CREDENTIALS=test.json
commands =
pip3 install dash[testing]
pytest --cov=dash_app tests/ --driver Chrome --driver-path $CHROMEWEBDRIVER```
I use py37 for local testing, and installed the chrome driver using brew cask install on mac. Everything works peachy there. (edited)
I’m using azure pipelines for continuous integration and testing. I use py37-integ for that.
When I do echo $CHROMEWEBDRIVER on my pipeline, I get back /usr/local/share/chrome_driver
but when tox runs in the pipeline, I get an error that has to do with it not finding the webdriver
2020-06-14 20:02:42,937 [ERROR] dash.testing.browser (get_webdriver, line 374): <<<Webdriver not initialized correctly>>>
Any ideas on how to proceed?
does tox clear or mess with PATH?
or other environment variables
what if you manually setenv it
How on earth does committing sub sections of a file work in vscode?
I have tried using git stage selected ranges, where I have highlighted something.... but when I come to commit there's nothing there to commit?
Hi Guys,
I am facing an issue to deploy django project.
I compiled all project files to .pyc, but i am unable to start the server with Gunicorn.
ExecStart=<venv_path>gunicorn --workers 3 --bind unix:/<application_path>.sock <application_path>.wsgi:application
Can i use .pyc with Gunicorn?
usually you dont need to manually create pyc files ever
what is the error you get from gunicorn
Do any of you use sublime text? And if so, what do you use as a debugger? ipdb? sublimedebugger?
How do I make a program check user input for an integer in an if statement?
@tawdry needle i did create pyc files manually, and then gave path to .wsgi of django application.
What is the best way to ship a django project? where code is not readable.
It's pretty trivial to decompile those
You were trying to ship a Django server application, but prevent the code from being readable? Seems like an odd thing to want
Also what do you mean by "application path"
You can't use full file names with slashes in python as module names
What you're trying to do might actually work, but you need to be more specific about how you set things up
Also keep in mind that pyc files are not portable across python versions or operating systems
Does OS matter? The VM should act the same between them
But yeah pyc files aren't something that takes much from the code if it were to be reversed
Yogesh don’t give Django app and host it on your servers
Hi, everyone. I'm using VS Code and I'm trying to add / remove interpreter paths that VS Code automatically detects so that I'm not using versions of Python that I've already deleted and can easily access versions of Python that I have since installed. For instance, I recently downloaded Python 3.7.7, but I can't use that version unless I manually type in its interpreter path, which I want to get automatically; additionally, the interpreter path detects Python 2.7.16 on my system, even though I deleted the files to 2.7.16 a long time ago and haven't used it since.
Is there any way I can manually add or remove interpreter paths so that I can switch between them more easily than manually typing in the interpreter paths myself? The fastest way I've found to do it is to copy-paste the directory for the versions of Python I want to use into the interpreter path search, but it still isn't as efficient as I would want.
Try the whole uninstaller thingy they got on windows if that's what you're using
@native umbra Will that uninstall VS Code without uninstalling Python and the dependencies I have installed?
The add or remove programs thing?
you just want python 2.7.16 gone in entirety right?
@native umbra No, I also want Python 3.7.7 to be added to the list of interpreter paths it gives me automatically when I try using a new interpreter.
Is this a Conda enviroment?
I don't think so.
run it locally and chat to it in a server
So im attempting to use docker so that I can develop a discord bot with a db. I am pretty new to Docker but have been able to throw this together (https://paste.pythondiscord.com/edoqijibug.py) But I want to be able to have the code update within the container when I edit the code on my host machine. Is there a better way to achieve this than rebuilding?
@tawdry needle @finite fulcrum @wooden ibex Thanks guys for your valuable suggestions, I have to probably go with normal gunicorn, nginx deployment.
@unkempt plaza If you create a bind mount for the directory with your bot's source code, then you shouldn't need to rebuild the image when you're using Docker Compose. You'd just need to restart the bot, which can be done by restarting the bot service via docker-compose restart bot. A rebuild would only be required if you changed packages in requirements.txt.
By the way, you don't need to run your bot in Docker in order to access the DB. You could still run the bot on the host and just expose the DB container's port to the host so that the bot can connect to it.
Hi, I have created a virtual environment using Pipenv, but when I try to pipenv install sqlite3 I get an error ERROR: Could not find a version that satisfies the requirement sqlite3 (from -r c:\users\X\appdata\local\temp\pipenv-1wf9lnf1-requirements\pipenv-iabquvct-requirement.txt (line 1)) (from versions: none) ERROR: No matching distribution found for sqlite3 (from -r c:\users\X\appdata\local\temp\pipenv-1wf9lnf1-requirements\pipenv-iabquvct-requirement.txt (line 1)) I don't get the error for other packages.
Wait sqlite3 might be in the standard library
Sqlite3 is not a pypi package and needs to be installed with python
If it didn't come with python then there are other ways of getting it, like with tkinter
Looks like I already have sqlite3 😅 Nevermind..
Didn't think of running just the DB in the container. That's smart. Thanks for the tips!
Any idea why when I do a python setup to make a universal build it's adding files that I have deleted? These are files such as init.py causing it to include all the files in the subdirectory to spite my setupy only specifying one of them. Any thoughts?
@ocean canyon you are using setuptools/setup.py?
does it only happen with universal builds?
I ran a clear cache on the setup.py --all and I think that worked.
So weird it just keeps taking older files till cache is cleared
Yea my model files were over the pypi 60mb limit so I had to restructure to pill down after install.
have you considered distributing the model separately
like how nltk makes you download data files
I have (non-administrative) access to a linux server where python is managed by conda
Is there a way I can get pipenv to work on that server somehow?
Right now the virtualenv command doesn't even exist
like how nltk makes you download data files
@tawdry needle Yes, I moved it into my gdrive with open sharing, and just have the model download as the library is loaded.
@west sluice usually modern python installations use the built-in venv
you should be able to pip install pipenv in the base conda env
or create a separate conda env for pipenv-based projects
does anyone know why Git for Windows would hang indefinitely upon trying to clone a repository? i'm trying to debug this issue for a coworker and having no luck
i cannot reproduce on my machine
@tawdry needle what's the difference between venv and virtualenv?
I've never used venv before
The docs outline the differences between them https://virtualenv.pypa.io/en/latest/
I find venv to be adequate.
hey guys, i have a question with git, hoping for some small guidance, i rebased my repo's branch to my master, do i submit a separate PR now? previously i was submitting all changes from my branch to the branch made for my changes on the original repo.
hope this makes sense
Sorry, I couldn't understand. Can you try rephrasing?
so my buddy made a branch for me to add a feature and cloned the repo, i made a bunch of commits to that repo and we would give me feedback and now i want to rebase it so that it doesnt enter as a bunch of commits. I rebased the branch to my own repos master. not sure what to do now
What do you mean by "so that it doesn't enter as a bunch of commits"?
Did you want to squash your commits into 1?
Well, you can squash via an interactive rebase. Just trying to get a clear picture of what's going on.
Yeah, I was using fix up to quash
you could also consider: why do i want to avoid showing "a bunch of commits"?
Idk, he asked me to
After you've squashed all you need to do is open a PR.
^
New PR right
Do you already have an existing open PR?
Yeah
Is it the same branch?

If your PR still is using the same branch then there's no reason to make a new PR
Assuming you are on GitHub, you could have saved yourself some hassle by selecting "squash and merge" when merging the PR on GitHub
people don't like merge because it's more difficult to track a repo with a ton of different branches
but downside is you can't see the work in that branch after the merge if you delete the branch
You can also rebase instead of merge the PR. https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-request-merges#rebase-and-merge-your-pull-request-commits
You can merge pull requests by retaining all the commits in a feature branch, squashing all commits into a single commit, or by rebasing individual commits from the head branch onto the base branch.
It's unclear what your collaborator wants you to do.
But have a read on that page
I feel rebasing has worst of both worlds
you get all the commits and you don't know exactly where they came in
That wouldn't be a problem in a perfect world where every commit is atomic and has descriptive messages

run it locally and chat to it in a server
@wooden ibex yeah, that's what im asking
i don't know how lol
hei guys do you know if there is a github discord out there ?
I am new to github and I wanted to ask you how i can merge an existing repostery to another axisting repostery ?
I would be realy thankfull if you could help me. Thank you
thanks guys
how can i host a bot locally temporarily to check if it works on a discord server?
@white grove you can just run it from your computer
I'm just running the python script
what does "won't run" mean
It just closes whenever i run it
when i run it through cmd it doesn't give a response
@tawdry needle
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.
so if i download this file, and run it with python on the command line, you're telling me nothing at all is going to happen, and it will exit with status 0?
i find that hard to believe
it looks like a correct, minimal discord bot
huh.
oh
wait... no. huh
im probably missing something. at least the code is posted and someone else can look
(this might be better in #discord-bots )
Hi, I have a cuestion, when I try to use a module called mcstatus it constantly shows me this: no module named mcstatus, and I have it installed
you're probably using the wrong interpreter
you might be able to remotely delete the branch, but that's super-dangerous
if it's just a typo, fix it with a new commit, and get on with your life
you could also "squash" the new commit into the old one, then "force push"
your repo may or may not allow that
thanks
use git commit --amend, and then git push --force-with-lease
hi, i've been told to come to this channel for help. I want to use the rdkit module on PyCharm but the installation process has been a pain. I've used homebrew to install it, and attached is the screenshot of what appears on terminal for rdkit. However, it doesn't seem to show up on any interpreters
https://cdn.discordapp.com/attachments/696350939535376404/723371910507004004/Screen_Shot_2020-06-19_at_1.01.34_pm.png
does anyone know why atom always opens with 2 blank files atom and ATOM_DISABLE_SHELLING_OUT_FOR_ENVIROMENT=false.
literally everything i have tried still opens those two (except for starting from cmd with atom --clear-window-state
please @ me if you have a solution or something you'd like me to try, i don't frequent this channel much
@iron dock this actually just started happening to me a couple days ago. i thought it was related to installing the linter packages. but that didn't fix it for me. only other thing i can think of is an OS update caused something (i'm on kubuntu 18.04)
finally took some time to look into the issue...
found a thread that states its a regression: https://discuss.atom.io/t/problem-on-atom-startup/75724
not sure. the workaround linked in that thread doesn't work for me...
i might just start over and go the apt route, now that its available. i think snap was the only way when i first started using it.
snap didn't work for me
installing via apt did work for me
@barren spoke
if you want to fix it
cool. might do it tomorrow. i'm winding down for the night... 😄
found a pycharm plugin
type :, hit ctrl+space to trigger code completion and boom
no more \:emoji: in discord to get unicode :D
@heavy knot
this is the code
and what abt +str?
k 1 sec
ye
i get this again
ohh
stntaxerror
syntaxeroor
time.sleep is wrong
can you just post the code as text? are you not able to access discord on that computer?
its really hard for many people to see that
yes
cuz it worked before
just now it doesnt
since i did ())
it works but now i got this
i got error in console
ye i do
wait
i see
BeautifulSoup not Beautifulsoup
ye
another error
lmao
yiu told me to put that in so idk
sorry im just a beginner
ye
the item that im scraping you mean?
ye
thanks for help tho
hi folks. I'm looking into tox for the first time for my project, coming from a background usually just working virtualenv and a requirements.txt. I'm curious about the right way to set this up in my – I totally understand how to configure the different envs in the tox config file and how to run them etc, but how do I version lock tox itself?
What if I'm using tox vX.Y.Z and my teammate is using tox vY.X.Z?
ive seen people have a requirements-dev.txt file
which lists the versions of all the things required in the dev environment
e.g. pytest, tox, mypy, sphinx, et al
that too, seems like you can use both
👍 thanks
Any idea how to unstage a file with PyCharm?
hmm.. back again with more tox questions: what is envlist actually for?
I'm trying to configure my tox environments such taht everything always runs on python 3.7, which I thought was accomplished by putting envlist = py37 at the toplevel [tox] block, but that appears to be the wrong idea
ok so I think that toplevel envlist is meant to prescribe which environments to run, which for me is just envlist = test,lint
now I'm trying to understand how to provision a dev environment, but when I do that, it seems to ignore all the requires in my top-level [tox] block
if anyone has atom can they explain this when i download script, to run code
Installing “script@3.26.0” failed.Hide output…
events.js:174
throw er; // Unhandled 'error' event
^
Error: ENOENT: no such file or directory, open 'C:\Users\domri\.atom\packages\script\node_modules\core-js\stage\0.js'
Emitted 'error' event at:
at errorOrDestroy (internal/streams/destroy.js:107:12)
at WriteStream.onerror (_stream_readable.js:734:7)
at WriteStream.emit (events.js:198:13)
at C:\Users\domri\AppData\Local\atom\app-1.48.0\resources\app\apm\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:303:14
at C:\Users\domri\AppData\Local\atom\app-1.48.0\resources\app\apm\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:333:16
at FSReqWrap.args [as oncomplete] (fs.js:140:20)
may i know whats wrong?
is there a package that takes a jsonschema and generates a marshmallow schema from it? like a more complete version of this SO anwer https://stackoverflow.com/a/55940387/2954547
I am using Marshmallow for serialization and de-serialization of JSON strings. From the Marshmallow API Docs (https://marshmallow.readthedocs.io/en/3.0/api_reference.html), it looks like you have s...
Anyone here use atom
@glacial pollen yep. whats up?
Whenever I run script the bot I made sends a message over once (depends on the times I run it) But if don't run it the edits aren't saved
i don't quite understand. what is the bot for? is it related to the edits aren't saved?
ok. and changes to your bot code aren't being saved in Atom, unless the bot is running?
No no that's not what I meant
I meant that whenever I try to change the bot and to smake sure the changes are applied i neeed to re run the cript and when I do that every command repeats itself(ex. !ping, it'll reply like:pong, pong)
I hope this IDE gets full python support in the future 😫
To note, you can get python to work though it is pretty hard to set up
do you really need to visualize all the keys you press? lol
dance dance ide revolution
@rotund beacon IDE name
when i contribute a branch from my fork to original branch, what should i do with my master?
how can I record how long a key was held down for. I tried messing around with the keyboard package, but I can't find a way to do it. Could I get some help with this? Any pointers?
I'm not sure of the specific package, I'm sure there's a lot of different ones you could use, but the idea is pretty simple.
When a key is pressed, you save the current time in a variable. When the key is released, the difference would be equal to the current time minus that first time.
https://stackoverflow.com/questions/24072790/detect-key-press-in-python
pynput seems like a good choice for a package to use
alright Ill try to look into that. Thanks!
how do i make an extension to run my interpreted coding language (made out of python) in vs code
From the ubuntu terminal with ohmyzsh, is it necessary to put .exe at the end of the executables in the path? (I am using WSL 2 on Windows).
Because, when I did subl.exe <file> it works, but subl <file> doesn't work even though it does in the normal command prompt.
I'm not sure if that is it though because code <file> works without needing the .exe at the end
Why would you do subl.exe on Linux?
Well, it's technically not Linux, im using wsl 2 on windows, also, why wouldn't you need subl.exe on linux? @wooden ibex
.exe isn't a thing on Linux
WSL 2 is Linux in VM
unless you are trying to execute Windows stuff via WSL in which case, please stop
oh.. I had that that was the whole point of wsl 😅
Ah, okay, so it seems that is an intentional feature actually
What are the options for migrating database in k8s?
I saw 2 options:
- migrating db from CI (exposing DB endpoint and credentials to CI)
- Using helm hooks to run a job before new version deployment (exposing cluster access to CI with helm (including DB credentials, seems even worse)
Dont quite like these, I dont host my own CI
To my macbook?
upload them to google drive then download them?
i don't really see how this is devops related
google drive?
have you not used google drive before
you just upload files and then you can download them again
I haven't used a mac before
Let's say i want to pin the current packages I have installed in my venv:
./venv/bin/pip freeze > requirements.txt
./venv/bin/pipdeptree | grep -P '^\w+' | grep -v 'pkg-resources==' > requirements.in
./venv/bin/pip-compile --generate-hashes --verbose
Is this a correct solution?
@graceful patio ok how can I insert the windows file to the mac's Pycharm now?
what
i'm so confused
isn't this just a case of 'upload file, download file, open in IDE of choice'
The whole list.
I uploaded the scraches file
onto your mac
im using atom.io and was wondering the fold feature, can i make a fold without using if/elif/else/while
@late briar does it not fold functions?
It does but there is a big section that I would like to fold so it’s neater
how can I show print statements in a fuctions in tkinter gui?
could you send an example
@mint heart
and explain what you are trinna do
so your trynna add text to a tkinter QUI
def sum(a,b):
print(a)
print(b)
return a+b
sum(a,b)
Label(root,text=sum(5,6))
Like here we have a print statements. How can I show these print statements in GUI
so your trynna add text to a tkinter GUI
its a button when I will click on the button I want to know what is happening behind so I have introduced print statements. and I want them to show in GUI
what
I want to show print statements in gui
so u want it to say "print ("bla bla bla")"
yeah
import tkinter as tk
root = tk.Tk()
T = tk.Text(root, height=2, width=30)
T.pack()
T.insert(tk.END, "Just a text Widget\nin two lines\n")
tk.mainloop()
that what u looking for
Hello all. If I'm using poetry for a project, how can I add a script to my path such that it can be run from anywhere and excecute in the virtual environment poetry created for it? I'd rather not install it and all its dependencies to my system python. My current solution is a bash script that changes the working directory to the project directory, but that has some disadvantages
@quartz plank try
[tool.poetry.scripts]
my-script = "my_library.__main__:cli"
or something like that
ah wait thats the wrong feature
1 sec
yeah i think
try that
@tawdry needle thanks for the suggestion. I have already done that, but to run "my-script" I need to be in the project directory and then I can run it with "poetry run my-script". I want to be able to run it from anywhere in the filesystem. Even if I add the project directory to the path, poetry only seems to look in the current directory and its parent for a pyproject.toml
you need to pip install it
or pip install --user
pip install --user /path/to/my/project
or pipx install ideally
ah ok, I was hoping to avoid that but if it's the only way I will do it
oh what's pipx I'm not familiar with that?
nvm I looked it up, sounds ideal. thanks for your help!
👍
https://pipxproject.github.io/pipx/ for anyone else reading
execute binaries from Python packages in isolated environments
someone help me make a key detection system for the dji tello drone go ahead with w go back with s
and go sideways with a and d
I need help with "installing" python... I have it installed but on Pycharm it says its not in the correct folder... How would I be able to change where pycharm looks for Python?
This documentation covers most of it
Also note that each run configuration in PyCharm can also have its own interpreter.
But, by default, it should be set to "Project Default", which means it will use whatever interpreter you set for the project as shown in the link I sent.
I reset my device (keep personal files) so the "Project Default" was deleted but the other files were not
I wonder if making a new project and copying the code over would work better
That wont work cause this is what happens when I create a new project
Ping me if you know how to fix that
@pearl phoenix Yep i have CD
so cd continuous development does what im hoping to do?
Shouldn’t matter. If you get banned you should not be able to join back
aws has a thing called code deploy that is built for that
it was just a web server
I think ima just try and find out if my friend can host a bot on roblox studio which is probably impossible :/
i retired the website and just put a static terminated page in s3 now though
ya whenever i merge a PR into master the ec2 instance pulls the repo and builds a new docker container and deploys it with docker compose
takes about 3 seconds and the bots back up and running
I think ima just try and find out if my friend can host a bot on roblox studio which is probably impossible :/
@heavy knot that’s probably not a good idea but you can try it
ah thats sweet
i guess the main caveat for me regarding aws is that given how mature it is, theres a lot to look through to find what you are looking for
that updates the server when a new version is deployed
nice
ya, ill be honest. the CD took a LONG ass time
next time i host on aws ill use it
just for setting it up?
and theres not a lot of documentaiton on it
theres many many diff ways to do stuff i just chose actions cuz i liked the yaml approach in the repo
i feel like amazon just has a culture of doing so much so fast so it gets a little disorgniazed
they are more mature than other cloud computing platforms because they have a bias for action
but it kind reflect in that things are messy
*reflects
i mean AWS is the most used cloud platform in the world bar none
theres a 0% chance it cant do what you want
oh i am sure it can haha
basically what i mean to say is that one of their competitors might be a little leaner in terms of their offerings and it might make things easier
providing more direction towards documentation and making it easier to find things
also, i dont know about azure or google cloud, but it is no fun that there is no free technical support haha
also i dont know how the free tier works on those
Isn’t google cloud gonna limit you?
AWS has a year of t2 micro
Isn’t google cloud gonna limit you?
@cunning falcon no idea lol. never used it
you can do 24/7 with on instance for free for a year
i couldnt find something like that for azure or cloud
you can do 24/7 with on instance for free for a year
@thin crescent yeah i used up my year
ahh rip
I think the free tier only gives you x amount of time
azure has something similar
yeah exactly
That’s not too bad