#tools-and-devops

1 messages Β· Page 53 of 1

rough marlin
#

and Linux, of course, is based around the Linux kernel

#

Do you know what a Virtual Machine is?

quaint saffron
#

yea, I know what a vm is

rough marlin
#

or have used Virtual Box or VMWare or something like that in the past?

#

ok

#

So, a virtual machine emulates all the hardware

#

Docker isn't a VM

#

Instead, it provides a little sandbox that looks like a base linux system

#

but uses the same kernel as the host OS

#

when you were running docker images in the past, did you see something about it pulling an ubuntu base or something like that?

quaint saffron
#

I've literally only just installed docker

rough marlin
#

Ah, that's ok!

quaint saffron
#

Never touched it before

rough marlin
#

You've used git though, right?

quaint saffron
#

Kinda, but not much

#

Only very very basics

rough marlin
#

Do you know how different commits apply changes on top of the last, right?

quaint saffron
#

yea

rough marlin
#

The idea is sort of the same for docker images

warm pollen
#

If I may add my own explanation fi that can help you understand, Docker will make so you'd run each container like they were their own little VM (even if they aren't), for example, if you select the debian base image, you'd run a sort of Debian VM. You can see the dockerfile as a recipe for making a container/image, which is basically the whole filesystem of your pseudo-VM. Docker will boot up the base image (the one in the FROM step), and run each and every step, in order to create your image. If you select a debian based image, you'd have to use Debian package manager, apt

rough marlin
#

That's what I was getting to: each "image" is a layer of changes, like a commit

warm pollen
#

By the way, Debian based images are a better choice for python container, because of the included C library

rough marlin
#

you can try it right now actually

#

docker run hello-world

warm pollen
#

(you should add the --rm flag)

rough marlin
#

it might download a base image, then the hello-world layer over that

#

and then run it once all the layers are in place

#

if you're on windows, the Linux that you're running docker in will be inside some sort of VM (WSL, VBox, whatever)

#

but each docker container will still use the system's linux kernel

#

to get back to where we started, the package manager and disk image state isn't shared between docker images or containers

#

if you want to make your own docker container definition to run a python project you made, you will need to choose a base image (Debian, Ubuntu, a specific python pre-built base image, whatever you want)

#

after that, you can use the system package manager to install clib you might happen to need

#

and after that, use pip as normal, probably

#

make sense? @quaint saffron

#

If not, that's fine too.

#

It's understandable if this is all a bit overwhelming right now.

#

You might also be asking "why should I use docker? This seems like a bunch of pain for no reason"

#

If you're wondering that, we can explain why people use docker if you'd like.

#

There are pros and cons to it, and for some situations, it's a great idea.

quaint saffron
#

It kinda does

#

I'm kinda confused on how I know what distro or whatever I'm using, because to my knowledge I'm not specifying one

#

Wait nvm I am

#

So

#

I have two services

#

A python one, and a linux (alpine) one

#

So if I need to install programs etc. do I need to use the linux service?

#

@rough marlin

#

Can you explain what services are, because I think that's what's confusing me right now

rough marlin
#

uh, i'm not sure what you mean by services

#

do you mean docker containers?

quaint saffron
#
version: '3'
services:
  web:
    build: .
    ports:
      - "5000:5000"
    volumes:
      - .:/code
  redis:
    image: "redis:alpine"```this is my docker-compose yml file
rough marlin
#

Ah

#

so

#

It looks like you have two containers

#

a web server that you're mounting a code folder into, and a redis:alpine container

#

im rusty with docker at the moment

quaint saffron
#

Basically I've got a flask application, that I want to use redis in

#

The redis stuff (I think) is within the redis:alpine container

#

And I'm somehow like 'importing' that into the web container

#

To be honest I don't really understand how it actually works, and what relevance the redis container actually has

rough marlin
#

So

#

I'm not 100% sure how this works for compose either, but I don't think you're importing it exactly

#

docker compose, from what I remember, might help automate or at least describe port setups

#

Are you following a tutorial right now?

#

@quaint saffron

#

Redis does a bunch of stuff, but to my understand it's big draw is that it's like a dict as a network service that keeps everything in memory so it's fast, but it also can replicate the data across instances automatically

#

so you can use it for stuff like keeping track of which login sessions are still valid

#

If you're following a tutorial, I don't know what it uses it for, but there's a good chance it's login session tracking.

#

Regardless, the flask app will act as a client accessing redis

#

so it'll look like:
HTTP request -> Flask -> redis query

#

after which you'll have a chain of messages going the other way :
redis -> Flask -> http response to client

#

make sense?

quaint saffron
#

Yea, that makes more sense, thanks @rough marlin

#

Sorry had to help my dad with something

#

I think I understand it all now, thank you πŸ‘

rough marlin
#

You might need to specify ports to share on the redis container in the compose file, i don't remember exactly.

#

I think Akarys can help you better.

warm pollen
#

Your service is named redis, you should be able to access it at http://redis/ from the other container, if that's the question

finite fulcrum
#

A while back I restructured my project by moving modules into a package dir, but probably didn't do that through git and now I found out it thinks most of the files were deleted and then re-added (https://github.com/Numerlor/Auto_Neutron/pull/6/files); is there any (non messy) way of letting it know that they are the same file to get their history back and a normal diff?

neon torrent
#

I'm having an odd issue with black and github actions. running black in exactly the same way as it's run in the GA works fine locally, no changes - GA shows two files it would reformat.. any idea how something like that could happen?

wooden ibex
#

@quaint saffron Two things, don't use Python-Alpine: https://pythonspeed.com/articles/alpine-docker-python/
Also, you really really shouldn't use mounts with docker images for code, mounts should be reserved for stuff that can't be rebuild like databases, with docker compose, it will build the new image with new code BEFORE it swaps out existing container, if py.dis bot is fine with it, you should be fine with it

Python⇒Speed

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

tawny temple
#

Bind mounts are useful for code for local development. So, still copy the code into the container. But when you run with compose, the bind mount it uses will take precedence.

wooden ibex
#

Sure but local development could also just be running the code locally

#

my point is code should be in container, if you need to deploy new code, swap out container, don't try and swap it out using bind mounts/volumes whatever

#

and if you get to the point where you have always on web service, it's time to talk about Load Balancers and warming up

topaz aspen
neat creek
tawdry needle
#

@topaz aspen setup.py and requirements.txt serve 2 fundamentally different purposes

#

setup.py tells Setuptools/Pip how to install your package, which includes the least-restrictive list of dependencies/requirements needed for installation

topaz aspen
#

I don't usually distribute packages, that's what setup.py is more geared for?

tawdry needle
#

yes

#

its exactly for distribution

#

requirements.txt can be used for a variety of purposes, but imo it's best used for specifying and replicating an environment

#

not unlike conda's environment file

topaz aspen
#

right cool - phrasing on pip-tools site seemed to imply they were interchangable, which didn't make so much sense to me as I understood things

tawdry needle
#

requirements.in from Pip-Tools is just a tool to help you create a very strict requirements.txt

#

well if you arent distributing your django app (which you usually aren't) then the difference is less significant

#

you can use setup.py to "distribute" the application to yourself along w/ all your deps and such

#

or you can use requirements.txt

topaz aspen
#

hrm - would you ever use setup.py for a project rather than a particular package? I guess it could be? I always use requirements.in

tawdry needle
#

setup.py can install multiple packages πŸ€·β€β™‚οΈ

topaz aspen
#

sure - the deps for a particular package tho

tawdry needle
#

so you can have src/pkg1, src/pkg2, and src/pkg3 and a single setup.py that installs all 3

topaz aspen
#

oh ok πŸ€” hrm

tawdry needle
#

setup.py really is for a "distribution" i.e. a collection of one or more python packages

sand horizon
#

Yep

#

but then there's Cython...

heavy knot
#

hi

#

I have a question about git.

#

Let's say I have two branches. If I want to merge commit from develop to master. Is it fine if I just do git merge master. Or do I ALSO need to do, git checkout master; git merge develop after that

tawdry needle
#

@heavy knot the latter

#

you need to make sure you are on the "base" branch before merging

#

the current branch is always the "base" for the merge

#

obviously if you are already on master you don't need to check out master again

heavy knot
#

@tawdry needle hi.. sorry to tag you

#

but I don't understand clearly

#

let's say I'm on develop and added a test, master is working fine, but I want to add my commits from develop back to the master...

#

master is the main branch, it's just that I'm not on it right now, and develop is ahead because that's where my recent commits have been made

#

so in this case is it fine just to do git merge master.. all my changes on develop will get merged to master?

tawny temple
#

git switch master then git merge develop. Merging master into develop right before would be redundant.

#

So you need to do the latter, but not in addition to the former.

#

Only do the latter.

#

By latter/former I'm referring to your original message.

heavy knot
#

thanks Mark

tawdry needle
#

oh yeah, switch is a thing now

#

git merge <thing> says "merge <thing> into my current branch"

wooden ibex
#

Few people merge in git anyways

#

most of time it's a pull request in github or similar

tawny temple
#

For merging into master, yes. But merging master into a feature branch is more common, though I prefer to rebase.

#

It's still not too common though.

tawdry needle
#

i merge all the time

tawny temple
#

Do you often work on large features?

#

It'd make more sense then

#

Unless I have a suspicion something in master interferes with what I'm working on, I won't merge. I'd rather finish my work and resolve conflicts all at once if needed.

tawdry needle
#

i tend to use short lived feature branches

#

which i merge back to master

#

trunk-ish based development i guess

#

that's in solo projects though

#

actually i do that in most projects

tawny temple
#

Okay, so you mean you merge frequently into master?

wooden ibex
#

We do trunk as well

tawny temple
#

I thought you meant merging master into feature branches.

tawdry needle
#

oh, yuck no

tawny temple
#

If you do solo dev, then PRs make less sense.

#

So yeah, merges would be frequent through git

wooden ibex
#

I do PRs in solo

tawdry needle
#

interesting

wooden ibex
#

it helps me to see what I've done

tawdry needle
#

thats not a bad idea if you're doing it at work, for more visibility

tawny temple
#

I could see some merits to it, organisational purposes.

tawdry needle
#

isnt that what commit history is for though? πŸ˜›

wooden ibex
#

sure but github is more clear

#

it's because Github gives me some clarity sometimes

tawny temple
#

It's a way to group commits without actually squashing

#

GH will show the related PR for the commits

#

And you can view it for a broader context, without actually having to explain the same thing in every commit message

#

I can see some merit too it, but it doesn't really align with what I want to do

wooden ibex
#

we actually don't squash at all at work

#

which shocks some people

tawdry needle
#

no, i am morally opposed to squashing

tawny temple
#

I'm not shocked

wooden ibex
#

we actually prefer not to squash either

#

I'm not a fan either

heavy knot
#

squashing rewrites history, thats bad to do :<

tawdry needle
#

that said, i do support rebasing to clean your shit up before making a PR or pushing to a public repo

wooden ibex
#

we don't do rebase either

#

just merge and it all goes in

tawdry needle
#

and if a branch goes stale?

#

obviously if it's too stale a rebase turns into a mess anyway

wooden ibex
#

either delete the branch if not in use or resolve conflicts and merge

#

leaving a branch open is big no no at work

#

only time it happens is when a developer gets pulled off something

#

but it's great way to show that developer might be task switching too much

#

while we do a ton of JIRA bullshit, stale branches are actually developer easy way to see that someone is having issues

tawdry needle
#

when a developer gets pulled off something
sounds like a regular week at my job πŸ™„

wooden ibex
#

either they are being tasked switched or having trouble completing work

tawdry needle
#

"hey you know that thing you were working on that was urgent? well the VP is on vacation for 3 weeks, i need you to do this other urgent project that you didn't even know about until right now, do you think you can get it done for me 2 weeks from today?"

wooden ibex
#

my work is better then that thankfully

#

sorry, all new work must enter at start of the sprint

tawdry needle
#

my situation is a bit different because im not actually a programmer or in a software engineering dept

#

and data science is fundamentally more open ended and harder to jam into a "sprint" than programming

#

except in relatively straightforward easy projects

#

my friend works at a company that uses a method developed by basecamp (i think) that works in a six week cycle

#

there's some other structure around it, but it seems like a nice balance between the original goals of agile and not feeling like a race all the time

wooden ibex
#

we do 2 weeks and there is some of bullshit of "SHIP SHIP SHIP"

hushed plume
#

how do i echo fancy text in a batch file?

heavy knot
#

is this the right topic to ask in relation to Packaging a .py script?

acoustic shadow
#

Hello! Can I ask questions about python pip here?

hushed plume
#

#help-kiwi #help-apple you can get support here if it's with python, stuff that is other than python is discussed here

naive sky
#

can any one send me the Screen shot of pycharm ?

#

i want to see how it looks ?

tawny temple
#

There are screenshots readily available online already

topaz aspen
#

Do people typically use pre-commit install, or just run it when they want πŸ€”

#

some tools (such as pylint) can be pretty slow, so making small commits can be a bit of a pain

tawny temple
#

Yes, I do

#

But I don't use pylint

#

It's fast for me

topaz aspen
#

hrm ok - yeah i think it makes sense, but pylint kills it

tawny temple
#

Try flake8?

willow bane
#

Hello, I'd like to ask about helping (ctrl+space) in pycharm.
I am using pro version with venv and pycharm not prompting methods for vars, class etc. It's problem only with pip-installed imports.
Only special typing (like example: class.Type) helping.
But I know a lot of people has this working out of the box.

topaz aspen
#

@tawny temple i think we're using both πŸ˜…

trail cove
#

Hi. Anyone want to peer review/criticise my script? Try to get better at putting things in functions, or maybe classes.. rather than have it is a 50 line script. I was thinking I could have a router class and move some of the netconf connect and port gathering functions to the router class

https://pastebin.com/gEHsrve6

It loops round a yaml file of hostname:ip, logs in to a box and grabs p2p links for core facing interfaces. Then it generates a BIND config file in the format interface.fqdn. Its just for a lab environment at the moment πŸ™‚

vestal cedar
#

So if I have a virtualenv in current directory of project, and later I move that project elsewhere it doesn't work anymore.

Since it uses absolute paths. Is there any tool/way to solve this

tawny temple
#

That's part of what venv tools aim to solve by not putting the venvs in the project directory by default.

leaden tartan
#

guys I have an issue with docker and Travis CI, can anyone help me in #help-bagel please

true vapor
#

You might have better luck just posting your question here

leaden tartan
#

Basically I need all three services- frontend, backend and databasse to be started before the cypress stage but that doesnt happen

tawny temple
#

You can design a script that will poll for those services to be online and then launch cypress

#

Docker itself cannot do this inherently.

leaden tartan
#

yep that's what I have been trying out for the past few hours, no such luck :/

heavy knot
#

is there any other way to make an .exe other than pyinstaller?

warm pollen
#

There's also nuitka and py2exe

heavy knot
#

well I tried pyinstaller but it gives probably false positives

finite fulcrum
#

I'm looking into signing my generated executables with a self signed cert. Since it won't be from a trusted CA windows and I'm not expecting users to install a certificate; so from an user view would there be any difference from running an exe signed by me and an exe signed by someone else with the same data?

wooden ibex
#

Probably get same error

finite fulcrum
#

Yeah I'm expecting windows to complain (looks like it got lost in the sentence) while it does give it a better look compared to the unknown publisher, but even though the app is open source and nobody would probably try anything malicious it feels a bit pointless if somebody can just replicate what the user can see from it

wooden ibex
#

Windows will screamf or sure

topaz aspen
#

when pre-commit runs does it do any sort of make like process wrt checking modified times? Or just run over everything even if it's not been edited since pre-commit was last run

finite fulcrum
#

How do the "Run anyway" exclusions work? Would it use the cert when present so other apps with the same name etc. pop up or would those also get ignored

wooden ibex
#

I think what's being committed is passed into script if you want but it's not mandatory

#

so you could do a full test on entire application if you want

subtle dew
#

hey yall just had a quick question regarding git. I'm testing out a new feature in my project. So I created a new branch. Anyway, I still want to make changes to the UI on the master branch. Will the changes persist across each branch? If it doesn't is there a way to do it?

topaz aspen
#

merge them in? unless i've missed the point there πŸ€”

wooden ibex
#

each branch until merged is seperate

#

pre-commit hooks can be annoying FYI

topaz aspen
#

what's up with pre-commit hooks

subtle dew
#

@topaz aspen Basically I want to know if the changes I make to the master branch are going to persist in this new branch I created. So if I add, commit, and push from the master branch, will the changes to the code there persist to the new branch.

topaz aspen
#

I'm assuming that pre-commit is referring to the tool pre-commit specifically.

wooden ibex
#

yes

#

JIan, no

topaz aspen
#

what's annoying about it then, any examples?

wooden ibex
#

it depends on how you think commits should be

subtle dew
#

is there a way to do it then?

#

Or just merge the branches constantly?

wooden ibex
#

some developers like to commit early and often so if you are running tests, it slows them down or even prohibits commits

topaz aspen
#

right - I have wondered about that yeah, though if they're slow one can just not install pre-commit

#

and run it before pushing to master manually

wooden ibex
#

I modified 80 line powershell script it had 5 commits because I was screwing with logic and tests did fail

tawdry needle
#

@topaz aspen git hooks are just scripts you drop into .git/hooks, of which "pre-commit" is one

wooden ibex
#

once I got it cleaned up, it was passing tests

subtle dew
#

so like theres no way to do what I'm asking

#

sorry for my ignorance I've never really dealt with git before

wooden ibex
#

Jian-Yang, Merge often but generally you shouldn't work on multiple branches at same time

subtle dew
#

oh ok

wooden ibex
#

I just find pre-commit hooks to be annoying to many developers work flow

topaz aspen
#

@tawdry needle yeah - there's pre-commit in ./.git/hooks/pre-commit but there's also the tool pre-commit, so i find that confusing... unless they're the same πŸ˜…

#

@wooden ibex don't install it then

tawdry needle
#

i assume the latter is a tool for managing the former

#

maybe it sets up .git/hooks/pre-commit as a shell script and appends stuff to it in a controlled way

topaz aspen
#

just run it when you want, that's a pretty easy fix it seems.... I guess pre-push would be nice

subtle dew
#

Alright thanks! Also, I should also note that this is a personal project.

wooden ibex
#

rie, that means all that work for pre commit hook is slightly wasted

subtle dew
#

But I get that I should practice this stuff

wooden ibex
#

thus why most people stick with checking before push and that's it

topaz aspen
#

@wooden ibex all what work, making a config file?

wooden ibex
#

writing pre-commit hook

topaz aspen
#

πŸ€·β€β™‚οΈ doesn't matter to me

#

i am just a user

wooden ibex
#

like what is your precommit hook doing?

topaz aspen
#

i would like to have pre-commit run on pre-push instead of commit by default though i think

#

well it runs flake / pylint / black / isort and stuff

tawdry needle
#

i just dont like having git do all that for me, idk why

#

id rather just do it manually

#

but its different if you have collaborators that you need to keep in line

topaz aspen
#

i don't see the difference

wooden ibex
#

that's something that should be done during pull request

tawdry needle
#

^

topaz aspen
#

I don't know what "during" a pull request means πŸ€”

wooden ibex
#

with Github/GitLab/Azure Devops/Bitbucket, you can prohibit Pull requests from being merged if all tests don't past

topaz aspen
#

yeah sure, but why not use it to keep things trim in the meanwhile?

#

white space / line endings etc

wooden ibex
#

Because there might be reasons the developers are not caring about that, maybe they are hacking at code, they don't want their train of thought disrupted by whitespace check they can clean up easily

topaz aspen
#

idk what you're doing for it to disrupt you

#

pre-commit run --all-files, that's it, run it when you like

wooden ibex
#

when I'm stuck on a problem, YOU HAVE WHITESPACE SO NO COMMIT/PUSH FOR YOU BECAUSE FORMATTING

#

jesus, screw you git, git commit --no-verify and leave me alone

topaz aspen
#

hrm ok lol I get what you meanπŸ€”

#

i don't agree with you tho

tawdry needle
#

well black just auto-formats

#

more annoying though it might mess up your diffs

topaz aspen
#

if removing whitespace ruins your train of thought i find that odd

wooden ibex
#

recent commit message "FIrst attempt at fixing this mess, I hate this block of code"

#

I will commit code that doesn't work because I want to see attempt A vs Attempt B

topaz aspen
#

i guess there are more commits like "pre commit fix" and stuff when doing it as the last thing before pushing, but that's nothing either

#

i think i get your point, i just don't agree

wooden ibex
#

it's fine, do what you want

#

you should do all those checks PERIOD so it should be enforced on pull request

#

there is no reason to finger wave the devs twice

#

once is enough

topaz aspen
#

it's automatic

wooden ibex
#

are you going to block commit?

topaz aspen
#

if someone's upset because their whitespace was removed they need to have a rest

wooden ibex
#

it messes with diffs

topaz aspen
#

if you run it consistently the diffs should be more consistent shouldn't they?
that's something I'm not too sure about

wooden ibex
#

most people diff program show all lines, I don't need to see lines that it was "remove whitespace"

topaz aspen
#

hrm - in this scenario are you assuming that a single dev is working on a particular file?

wooden ibex
#

not always

topaz aspen
#

rather than multiple people interacting with it

wooden ibex
#

sometimes at work, when someone wants help, they will commit, push and ask developer to pull their branch and view

topaz aspen
#

what if they have a different editor setting and it changes things

wooden ibex
#

changes what things?

#

if you are doing python project, I hope you ahve some standards around whitespace and like

topaz aspen
#

whitespace / line endings / whatever - how do you enforce consistency in a way that your diffs are as you've described them being when multiple people are working on the same file

wooden ibex
#

we don't do a ton of python but C# allows standards to be set in a file

#

so it goes with project

topaz aspen
#

pylint did recently annoy me though as it was quite slow and discouraged small regular commits when pre-commit was installed

wooden ibex
#

I thought flake and like had similar

topaz aspen
#

yeah flake does, hrm... maybe there can be pre-commit overkill

wooden ibex
#

seems pokey to do to developer, write something that happens on git hoster of choice during pull request

#

and don't quibble over individual commits, they ultimately are not important

topaz aspen
#

yeah maybe... sometimes a project can sit for a while without getting merged for us

#

which isn't great in itself, but it is what it is

wooden ibex
#

push again, someone might push because they want to save

#

we use VDIs you are encouraged to push before logging off because VDI might get closed, and if VDI god gets angry, you might come back to fresh work lost

topaz aspen
#

fair, we're v. small so there's nothing like that going on

wooden ibex
#

do yall use github or anything of the like?

topaz aspen
#

dropbox mainly

#

sorry i was joking - we use gitlab

wooden ibex
#

I think you have bigger problems then your commit hooks

#

just have gitlab scan your pushes and enforce during pull requests

topaz aspen
#

we use ci on gitlab, hrm... there's probably a bunch of shit going wrong in there tbh

#

with regards to best practices or whatever at least

leaden tartan
#

Hey guys i need some advice using docker.

I am making a website which uses a django backend, vuejs frontend and postgres database. I am using tox to test the backed and cypress for the frontend. I execute the tox tests right in the backend container and it works fine. However the cypress tests have a lot more dependencies and has been proving difficult to execute in the same container as the frontend.

I tried to switch the base of my frontend from nodejs:alpine to cypress/included (which is a pre-configured image provided by cypress) and everything works fine.

However I am left wondering- is it better to just separate two containers, one for the frontend development and the other for executing cypress tests in?

vestal pier
#

hmmm, is pipenv uninstall the proper command to remove a package? When I do this, it says the package is uninstalled, but it remains in the Pipfile, making the uninstall useless.

#

ah, pipenv update apparently

unreal juniper
#

hello all, ive just been playing around with AWS lambdas on python with npm serverless and the serverless-python-requirements plugin. Locally I have a conda environment setup with numpy/scipy/pandas/networkx.

Using serverless deploy and invoke I have managed to get my test program running (it just imports numpy/pandas and networkx and prints out some objects I make quickly) and everything works it seems.

What I am confused about is that the resulting AWS lambda function deployment package is >50MB (it is ~70MB) - so I was expecting for it to not work? I'm curious as to why it seems to be working?

#

my handler function:


import numpy as np
import pandas as pd
import networkx as nx


def main(event, context):
    a = np.arange(15).reshape(3, 5)
    print("Your numpy array:")
    print(a)

    print('pandas')
    print(pd.DataFrame.from_dict([dict(a=1, b=2), dict(a=3, b=4)]))

    print('networkx')
    g = nx.from_pandas_adjacency(pd.DataFrame([[1, 1], [2, 1]]))
    print(g.nodes)
    print(g.edges)


if __name__ == "__main__":
    main('', '')


warm raven
#

anyone really good with curl?

wooden ibex
#

!ask

finite fulcrum
#

What kind of hardware do github actions run on? I'm looking into migrating pyinstaller building to them and would like to know roughly how much it'll take

wooden ibex
#

Whatever is lying around

#

All they promise you is you will get OS you asked for and processor arch you asked for. Everything else is at whim of Azure gods

finite fulcrum
#

Guess that explains why I couldn't find much about it

wooden ibex
#

Few people care

sand thistle
#

alright how does git checkout work, and is that what I need to do after merging

#

.<

sand thistle
#

disregard

topaz aspen
#

Anyone using dephell? https://github.com/dephell/dephell

GitHub

:package: :fire: Python project management. Manage packages: convert between formats, lock, install, resolve, isolate, test, build graph, show outdated, audit. Manage venvs, build package, bump ver...

idle swallow
#

hey, how do I add all things except what is in my .gitignore?

#

is it git add all .gitignore?

topaz aspen
#

@idle swallow git add .

idle swallow
#

does it automatically exclude the files and directories specified in .gitignore?

topaz aspen
#

that's the point of .gitignore, so, yes

sly sleet
#

@idle swallow if you already have stuff that would be excluded by the gitignore

#

you can use git rm -r --cached . first

#

then git add .

#

make sure you dont have uncommitted changes

idle swallow
#

oh awesome, ty you two. did not kno I could use that cmd

inner mesa
#

I have removed a file and pushed to a branch that's different than master, now I would like to revert that commit and not remove that file anymore. How do I revert that?

sly sleet
#

@inner mesa

warm pollen
#

git reset HEAD^1 --hard basically

marsh oyster
#

Hello, I have a private repo and I wish to review merge requests locally , but the issue is , since the repo is private , forks would also be private and hence Im not able to git fetch from a forked repo to review changes locally , is there any way I can do this?

sly sleet
#

uh doesn't github have organizations or smth?

marsh oyster
#

Im using gitlab @sly sleet

sly sleet
#

oh

#

gitlab has groups it looks like

marsh oyster
#

so with this , I can git fetch even private repos @sly sleet ?

#

actually , I dont intend to give maintainer access to others, all I want is to review their changes locally before merging

#

reviewing with gui is kinda painful

errant gyro
#

I'm using comtypes package to interface with Outlook. I want to use it to find people that have marked email as spam across our organization. However when I do:

#

I get a class object and I'm not sure how I can use that.

wooden ibex
#

Is this Office365?

wooden ibex
#

@errant gyro

tawdry needle
#

i tried using dephell once to generate a setup.py from a poetry-based pyproject.toml and it just gave me weird errors @topaz aspen

topaz aspen
#

@tawdry needle hmm ok, I've not really worked out what the point in it is yet tbh

tawdry needle
#

it seems like it's pip-tools + a converter between python package spec formats

topaz aspen
#

I think I read something about setup tools versions being an issue it solves, but I've never had that problem in the first place

errant gyro
#

Is this Office365?
@wooden ibex Sorry I was away from the PC this is outlook 2019 not office365 version

wooden ibex
#

Is it hooked up to Office365 or Exchange server? Rules are stored server side so you can just use Powershell and pull from there

errant gyro
#

no it is on IMAP

wooden ibex
#

Nevermind then, yea, you will have to parse the class

errant gyro
#

Do you know of some way I can start into that?

heavy knot
#

PyCharm has stopped automatically using cd <project-directory> in the alt + F12 triggered terminal.

#

Every time I have to navigate to wherever from $HOME dir for some reason

wooden ibex
#

Spencer, I do not, haven't used Python against Outlook

blazing magnet
#

So I'm working on introducing documentation to this project (it has none) and was curious for opinions. My initial thought was autodoc since that seems to be pretty well respected, but pydoc being part of the standard library makes it a tempting option. I also know of pdoc3 as a thing that exists, but have heard far less about it. Was curious what preferences you have since I've worked with none of these tools and I'm sure there are well informed opinions to be had.

leaden tartan
#

@blazing magnet Sphinx is the standard when working with python projects. coincidentally you have that in your name too

blazing magnet
#

that's the feeling I've been getting reading through stuff. Thanks for confirming that. I'm honestly sort of fuzzy what the difference between autodoc and sphinx is. Is autodoc a fork of sphinx?

leaden tartan
#

don't take my word on this, but I think it's the other way round. Sphinx is just autodoc on steroids and automates a lot of the process and provides a nice plugin system too@blazing magnet

blazing magnet
#

ahhhhh, okay. Cause I would see them used semi interchangeably, so that would make a lot of sense.

#

I'm also realizing dosctring style is an important choice

#

So even though pep 257 defines docstring conventions, the google, scipy, etc styles all conform to it?

leaden tartan
#

there are many different ones, there's a Google one, one from numpy and a few others

#

i dont know which one is the most used, but I personally use the one from numpy

blazing magnet
#

gotcha, it does look nice and verbose, which is something this project sorely needs

#

well, thanks for all the help. I was already leaning towards both those options so it is reassuring to know they are that well regarded.

leaden tartan
#

yeah no problem and good luck

tawdry needle
#

@blazing magnet Personally I recommend type annotations along with google style doc strings

#

And yes, sphinx

#

rST is not the best and sphinx is annoying to configure. But at the end of the day it does the job

#

Numpy style is fine too, but I find it too verbose and therefore intrusive in my source code

umbral jay
#

Is PyCharm Professional a reasonably good IDE for javascript development using frameworks like Vue, Angular? Wondering if it's worthwhile to upgrade to professional

leaden tartan
#

@umbral jay you can go a lot way with vscode if you configure it correctly

umbral jay
#

@umbral jay you can go a lot way with vscode if you configure it correctly
@leaden tartan Thanks. I'll explore, though I'll be surprised if VS code can be better. Can VScode be better than pycharm professional since it's free? Nobody will buy pycharm pro or webstorm if VS code is just as good.

rare mirage
#

Very basic question: if I closed an issue in GitHub myself submitted, can people still comment on it?

#

Thank you very much beforehand :)

blazing magnet
#

@umbral jay stack overflow did a survey of what editor or IDE developers used and vscode won overwhelmingly, I think it about a 50% use rate. It is highly configurable, and thus can really compete with just about anything. To give a comparable example, vim is free and I think you can find someone using it in just about every group.

leaden tartan
#

@umbral jay adding to what @blazing magnet said, vscode is also much lighter compared to pycharm and thus much more preferred. the only reason why people would use pycharm professional is for example getting help and support quickly when something goes wrong.

This would have been a problem if vscode had a small community, but it doesn't, so most of the times support isn't a problem either. They have an excellent bug tracker and support group, and you can probably find a solution to your problem right here on python Discord before even having to open an issue on their github.

#

i dont really see why anyone would spend money on something which has an objectively better and free competitor in market

umbral jay
#

thank you for the comments on VScode. I think JetBrains is screwed by VS code. Haha. Seems like VS code might even kill Microsoft's visual studio.

leaden tartan
#

Visual studio is a different story altogether. it has been in market for ages and is set there since many developers don't really want to have to master a new piece of software when visual studio works for them well.

#

my dad uses visual studio and when I asked him to start using vscode, he asked me to fuck off

#

so yeah visual studio is not gonna go anywhere anytime soon

#

Very basic question: if I closed an issue in GitHub myself submitted, can people still comment on it?
@rare mirage yeah they can

heavy knot
#

Hello,
i just started using docker and downloaded my first image from a github repo. Now my question is if docker is using my pip modules from the current env or does it have its own env?

leaden tartan
#

@heavy knot you can consider docker to be a completely isolated operating system, it doesn't really depend on anything on your host system unless you explicitly mention it.

so to answer your question, yeah docker has its own python installation and pip modules

heavy knot
#

thank you very much IgnisDa.
Do you know how i can check which pip modules the docker image is using?

leaden tartan
#

which image are you using? @heavy knot

heavy knot
leaden tartan
#

do you have a Dockerfile? @heavy knot

heavy knot
#

should be this one

# Name: Ciphey 
# Website: https://github.com/Ciphey/Ciphey
# Description: Automatically recognize and decode/decrypt common encoding and encryption techniques.
# Author: Brandon Skerritt: https://twitter.com/brandon_skerrit
# License: MIT License: https://github.com/Ciphey/Ciphey/blob/master/license
# Notes: ciphey
#
# To run Ciphey using this Docker container, create a directory where you'll store
# your input and output files. Then, use a command like this to open a shell inside
# the container where you can run "ciphey" and have your directory mapped as
# /home/nonroot/workdir inside the container:
#
# docker run -it --rm -v ~/workdir:/home/nonroot/workdir remnux/ciphey
#
# The password for the container's user nonroot is nonroot. The remnux/ciphey image is
# hosted on its its Docker Hub page.

FROM ubuntu:18.04
LABEL version="1.0"
LABEL description="Ciphey - An Automated Decoding and Decryption Tool"
LABEL maintainer="Lenny Zeltser"
ENV LANG C.UTF-8
ENV LANGUAGE C.UTF-8
ENV LC_ALL C.UTF-8

USER root

RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y \
  apt-get install python -y \
  python3-pip sudo && \
  rm -rf /var/lib/apt/lists/*

RUN pip3 install --upgrade pip && \
    python3 -m pip install ciphey

RUN groupadd -r nonroot && \
  useradd -m -r -g nonroot -d /home/nonroot -s /usr/sbin/nologin -c "Nonroot User" nonroot && \
  mkdir -p /home/nonroot/workdir && \
  chown -R nonroot:nonroot /home/nonroot && \
  usermod -a -G sudo nonroot && echo 'nonroot:nonroot' | chpasswd

USER nonroot
ENV HOME /home/nonroot
WORKDIR /home/nonroot/workdir
VOLUME ["/home/nonroot/workdir"]
ENV USER nonroot
CMD ["/bin/bash"]
leaden tartan
#

docker run <CONTAINER NAME> pip list @heavy knot

#

you can check CONTAINER NAME using docker ps -a. Note that the container should be running before you execute the above command

heavy knot
#

thank you very much

#

that worked

#

πŸ‘

leaden tartan
#

you're welcome

obtuse rapids
#

If you run docker-compose behind traefik, how do you run a staging and prod environment on the same server?
I think the envs need to be on the same network for traefik to work, which means that each container should have a unique name? (e.g. pg_staging and pg_prod for postgres, with connections to the DB defined in an env var?)

#

I have a feeling that my production Django is connecting to my staging db, so I figure that's the problem.

#

@ me if replying.

quasi scaffold
#

hello

warm pollen
#

@obtuse rapids do you want to keep the two databases running on different engines?

quasi scaffold
#

How i can solve this error of pip install for tensor

#

i hope this is the right channel for this

obtuse rapids
#

Both Postgres. Same engine. Different volumes.

warm pollen
#

Okay, I'm assuming you use two different credentials for each environment?

obtuse rapids
#

Just want a staging.patryk.tech for automated staging, and a manual production job.

#

Yeah.

warm pollen
#

Sounds like you want to use two containers named differently, yeah

obtuse rapids
#

I thought docker would prefix things with the project name, but apparently that doesn't work for containers on the same external network lol

warm pollen
obtuse rapids
#

They need to share a network so Traefik can route to them.

#

Would be better to do it on separate hosts, I guess...

#

But servers get expensive.

warm pollen
#

I don't know especially about traefik, but it sounds like you want to make them into the same projects, so they can share the same database

obtuse rapids
#

No, I specifically one two separate but identical setups.

#

Separate databases.

#

Different engine, then.... I may have misunderstood the question.

warm pollen
#

You want one or two postgres containers?

#

Because having only one of them and making two databases on it would be totally doable

obtuse rapids
#

Two containers

#

Staging should be identical to Production

#

It should just be automatically built on every push

#

(So, identical, but the code can be a few commits ahead)

#

Two servers would be ideal.

#

I need a sponsor xD

warm pollen
#

In that case, you probably want to isolate them completely, so have two different projects

#

tell me if you find a sponsor, I'll try to get sponsored as well haha

obtuse rapids
#

No.... they should be as coupled as possible :p

#

The point is, I make changes, and gitlab-ci builds the staging environment.

#

I can test that everything works, and as the envs are nearly identical, it should also work in production.

#

It's just like the pre-release copy.

warm pollen
#

Right

obtuse rapids
#

I also don't want the staging DB to pollute my production site.

#

Like I have a check whether the environment is set to staging, and if so, it loads some initial data (blog posts, admin user) from a script.

#

The staging DB should/does not persist.

warm pollen
#

Make sense

round bone
#

Hello!
Fairly new to this group.

Wanted to check if anyone had any experience with jitsi?

obtuse rapids
#

Wanted to check if anyone had any experience with jitsi?
@round bone the zoom alternative? We used it for corona-distanced taco night lol

#

What about it?

round bone
#

ahaha

#

@obtuse rapids Wanted to see if anyone knew that if I updated jitsi if it has some impact on the preset network configs?

#

its on its own ubuntu server.

obtuse rapids
#

Oh, I haven't hosted it myself How did you install it? From the official repos? Third party repo?

round bone
#

its a docker imagine from the offical repos

#

image ~~~

#

I wanted to avoid changing any of the configs and just update it to the latest stable version.

obtuse rapids
#

How did you configure it?

#

Normally, you would keep config outside the image with docker.

#

Depending on the image, I either COPY foo.cfg /etc/foo in a DOCKERFILE, or mount it as a volume... Or use ENV variables.

round bone
#

Ah ok, I didnt configure anything at all so not sure, I think the port forwarding and proxy network configs are done through nginx

#

The reason why I wanted to keep the config same is because well it works. Its just that I though it will be better to update jitsi itself to the latest version.

obtuse rapids
#

In those cases, if they keep the images up to date, it should be safe to just docker pull the latest image.

round bone
#

In those cases, if they keep the images up to date, it should be safe to just docker pull the latest image.
@obtuse rapids Yah, thats what I was thinking

obtuse rapids
#

But as I said, I never ran it self-hosted, so don't blame me if your faucet catches fire πŸ˜…

round bone
#

ahahahah

#

Yah tbh I am fairly new to git and docker so any help is nice really :DDD

obtuse rapids
#

good luck πŸ™‚

cinder orbit
#

guys is there server dedicated to vim?

#

I already found one

proper swift
#

I have a docker container that's returning an error when downloading a file from remote; the old [Errno 30] Read-only file system. Anyone know why this might be happening? Super new to Docker, and I'm sure I'm doing something wrong.

#

The dockerfile in question:


# nvidia-docker 1.0
LABEL com.nvidia.volumes.needed="nvidia_driver"
LABEL com.nvidia.cuda.version="${CUDA_VERSION}"

# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES=all \
    NVIDIA_DRIVER_CAPABILITIES=compute,utility \
    NVIDIA_REQUIRE_CUDA="cuda>=8.0" \
    LANG=C.UTF-8


RUN mkdir /gpt-2
WORKDIR /gpt-2
ADD . /gpt-2

RUN pip install -r requirements.txt

RUN python3 download_model.py 1558M```
rare mirage
sand thistle
#

not sure if this is the right channel

#

i have a couple questions idk where to start

#

how come doing this

#
from staffDashboard.staff_app import app, db
from staffDashboard.models import User
from staffDashboard import load_parse_articles

if __name__ == "__main__":
    db.create_all()
    u1 = User(first_name="test")
    db.session.add(u1)
    db.session.commit()
    app.run()
    load_parse_articles.run_articles()
#

specifically the load_parse_articles.run_articles()

#

wont actually run my script when i run my flask app (my flask app works, but the code below I thought would run as well)

#
import csv
import requests
import xml.etree.ElementTree as ET
from datetime import datetime, timezone, timedelta
import dateutil.parser as dateparser

urls_311 = {}


def loadArticles():
    # url for sitemap
    url = "https://portal.311.nyc.gov/sitemapxml/"
    resp = requests.get(url, verify=False)  # creating HTTP response object from url
    return resp.content


def parseXML(xml_string):
    # parse xml
    prefix = "{http://www.sitemaps.org/schemas/sitemap/0.9}"
    dt = datetime.now(timezone.utc)
    root = ET.fromstring(xml_string)
    for url in root.iter(f"{prefix}url"):
        for loc, time in zip(url.iter(f"{prefix}loc"), url.iter(f"{prefix}lastmod")):
            obj_time = dateparser.parse(time.text)
            if obj_time >= (dt - timedelta(days=3)):
                # print(loc.text, "---", time.text)
                urls_311[loc.text] = obj_time
    #print(urls_311)
    return urls_311


def savetoCSV(urls_to_update, filename):
    # writing to csv file
    with open(filename, "w") as csvfile:
        writer = csv.DictWriter(csvfile, fieldnames=urls_to_update[0].keys())
        writer.writeheader()
        writer.writerows(urls_to_update)


def run_articles():
    # load xml from web to update existing xml file
    xml_string = loadArticles()  # parse xml file
    parseXML(xml_string)  # store news items in a csv file
    # savetoCSV(urls_311, 'new_urls.csv')

obtuse rapids
#

not sure if this is the right channel
@sand thistle sounds like a Flask question, so #web-development ... this is more for CI/CD, git, etc.
That said, do the other functions work? Maybe app.run() is a blocking call / endless loop, so it runs app.run() and never hits the next line? Try switching those two lines around.

leaden tartan
#

I am not sure where to ask this question but here goes:
My docker-compose.yml defines a service for postgres called database. Note that everything works as expected, this is more of a doubt that I need cleared up.
Also here's a part of my settings.py:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'db',  
        'USER': 'user',
        'PASSWORD': 'db-passwd',
        'HOST': 'database',    # <----- pay attention here
        'PORT': '5432',
    }
}

How does django know how to connect to the postgres container (even though they are in different containers)?

#

Here's a part of docker-compose.yml

#
services:
  database:
    image: postgres:alpine
    volumes:
      - postgres_data:/var/lib/postgresql/data/
    environment:
      - POSTGRES_USER=user
      - POSTGRES_PASSWORD=db-passwd
      - POSTGRES_DB=db
  backend:
    build: ./backend/
    command: python /app/manage.py runserver 0.0.0.0:8000
    volumes:
      - ./backend:/app
    ports:
      - "8000:8000"
    depends_on:
      - database
obtuse rapids
#
services:
  # The line below is used as the service name, so you can access it as database
  database:
    image: postgres:alpine
#

If you named it foo in docker-compose.yml, you would have to set "HOST": "foo" in your DATABASES["default"] dict as well.

leaden tartan
#

yes I know that, but what i want to ask is, how does this work? I tried to look it up on net, but I don't really know what to search for. Loopback interfaces?

#

Idk if they are related but I have no idea how this networking stuff works

obtuse rapids
#

docker-compose brings up a virtual network interface for your project.

#

And assigns those service names to the containers.

leaden tartan
#

Is there any specific that I can search for to better understand this stuff?

obtuse rapids
#
docker ps # lists running containers, so you can note the names
docker inspect container_name # whill dump a TON of info about your container
#

Is there any specific that I can search for to better understand this stuff?
Let me get out of bed and look through the docker docs on my desktop lol

#

docker inspect will tell you what names the containers use.

leaden tartan
#
"Networks": {
                "default": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "dd881b3dc8b4",
                        "database"
                    ],
#

Is this what I am looking for? (output of docker inspect)

obtuse rapids
#

Yeah. Aliases

#

This assigns the auto-generated machine name (which is pretty useless), and the service name from the compose file.

leaden tartan
#

do if i added "dd881b3dc8b4" to my DATABASES['default'] that would work too?

obtuse rapids
#

do if i added "dd881b3dc8b4" to my DATABASES['default'] that would work too?
Yes.... until your container's name changed, because e.g. you re-created it.

#

Or it gets generated with a different name on your dev machine and your production server.

#

Always use the name from the compose file.... that will persist.

leaden tartan
#

alright I just checked, the name does get regenerated

obtuse rapids
#

It would work, until it doesn't :p

leaden tartan
#

https://docs.docker.com/network/ these docs are very verbose... but if you want to understand how docker networking works, they are a great resource.
@obtuse rapids I will have a look at this. Thank you very much!

obtuse rapids
#

If you run docker exec -it project_django_1 bash (or whatever your django container is named), you can run commands inside that container.

leaden tartan
#

Also, i presume my frontend and backend services also work in a similar way?

#

If you run docker exec -it project_django_1 bash (or whatever your django container is named), you can run commands inside that container.
@obtuse rapids yeah I know this

obtuse rapids
#

From there, you can ping database and ping dd881b3dc8b4 and it should both work and ping the same IP

#

(or whatever your new name is, if you recreated it already)

leaden tartan
#

oooh cool i did not know that

obtuse rapids
#

You can also try ping frontend and it should also work πŸ™‚

#

and ping backend which should ping the django container from within itself.

#

Also, all docker-compose does is the same things as in the Networking Overview ... It just automates them.

leaden tartan
#

oh wow it really works!

#

thats supercool

#

Thank you very much @obtuse rapids

obtuse rapids
#

If you really want to learn, you can do it all by hand to see how it works πŸ˜„

#

And np 😎 πŸ€“

leaden tartan
#

also this is the output of docker network ls

#
NETWORK ID          NAME                DRIVER              SCOPE
e5bac06ff4ac        bridge              bridge              local
93d0988de6ad        host                host                local
988be0b459b3        none                null                local
c85762928b9d        project_default    bridge              local
#

I presume this (last one) is where all the actual bridging between networks work?

obtuse rapids
#

Last one is specific to your project, I think... started by docker-compose

#

You can also inspect those...
docker network inspect c85762928b9d

leaden tartan
#

yeah it dissapears after docker-compose down

#

by the way, is this a docker-only feature or present on all operating systems?

obtuse rapids
#

Is what a docker feature?

#

You can create virtual network devices on Linux fairly easily.

leaden tartan
#

this netwoking stuff

obtuse rapids
#

They're just virtual devices with virtual IPs.

leaden tartan
obtuse rapids
#

On Linux, pretty easy to create. On OSX, it should also be doable, because it's UNIX-based. Not sure about Windows.

#

You could

#

Would have to configure routing and whatnot.

#

Maybe I shouldn't have said easy rofl

#

but definitely doable. Docker just leverages existing OS features.

leaden tartan
#

Can you just tell me the command to do this on Arch Linux? I will research it myself further

obtuse rapids
#

Been a long time since I've done this, tbh πŸ™ƒ

#

I have had to configure bridges manually in the past, but yeah... not in a while.

leaden tartan
#

so behind the scenes, docker does all this for us?

obtuse rapids
#

If you use OpenVPN and whatnot, it also uses virtual network devices like a bridge or a tunnel.

#

Basically, yeah.

#

If you type ip a you can see a bunch of virtual devices if you have docker running.

#
16
#

One loopback, one WiFi, and 14 virtual lol

leaden tartan
#

I have 7

#

how can I list all?

#

alright I got it, removed the wc

obtuse rapids
#

Just do ip a

#

That lists all the information.

#

| grep -v '^ ' <-- I added this so it only shows lines that don't start with a space

#

and | wc -l to count them

leaden tartan
#

you do know a lot of stuff don't you?

obtuse rapids
#

LOL

#

What year were you born? XD

leaden tartan
#

nah it was a compliment really

#

im impressed

#

LOL
@obtuse rapids 2001

#

nice

heavy knot
#

<@&267628507062992896> <@&267629731250176001>

leaden tartan
#

but wrong channel?

obtuse rapids
#

So, yeah... you'd be -14 years old when I got my first computer :p

heavy knot
#

@deep estuary

#

@ashen gale

deep estuary
#

!ban @heavy knot NSFW

rancid schoonerBOT
#

:incoming_envelope: :ok_hand: applied ban to @stable timber permanently.

leaden tartan
#

that's some swift action, good job

cold gate
#

I've reported it to Discord.

leaden tartan
#

So, yeah... you'd be -14 years old when I got my first computer :p
@obtuse rapids and how old where you when you got your first pc?

obtuse rapids
#

4

leaden tartan
#

woah that's cool

obtuse rapids
#

It ran MS-DOS 3.0

leaden tartan
#

my first ran Vista i think

obtuse rapids
#

So yeah, you'll collect knowledge and experience too, if you keep at it πŸ™‚

#

I was 17 first time I ran Linux

leaden tartan
#

yeah I will, and thank you very much for spending so much time explaining all this

#

I was 17 first time I ran Linux
@obtuse rapids I win then, I was 16

obtuse rapids
#

yeah I will, and thank you very much for spending so much time explaining all this
What else would I spend my time doing? Actually working? Hah!

leaden tartan
#

mood

topaz aspen
#

I want to use a project with slight changes, but keep up to date with any changes that the project makes., I'm not sure what this is referred to as though. I'm pretty sure it's a thing.

So I clone proj to proj-custom, and in proj-custom i make some adjustments, proj is then updated, and I want to be able to track those updates and bring them into proj-custom, as well as keeping the customisations that I make πŸ€”

#

hopefully that's clear enough to ring any bells, never had to do this before.

leaden tartan
#
  1. Fork "OriginalAuthor/Project" to "You/Project"
  2. git clone https://github.com/You/Project
  3. cd Project
  4. git remote add upstream http://github.com/OriginalAuthor/Project
  5. To keep your project up-to-date with the actual project git pull upstream master
  6. To push the changes from the original project to your project git push origin master
    @topaz aspen
topaz aspen
#

@leaden tartan ah ok - "upstream project" is what it's called then i guess

leaden tartan
#

You can of course change the branch names as you wish

topaz aspen
#

You can of course change the branch names as you wish

yeah all good - never had to use this particular work flow before, i'll look that up though

#

thanks πŸ™‚

leaden tartan
#

yeah @topaz aspen upstream is a conventional name, you can call it Richard Hammond and type git push Richard-Hammond master if you want lol

topaz aspen
#

yeah naming is fine - i wasn't sure what this sort of workflow was referred to as though

leaden tartan
#

idk what this work flow is called but this is what I use

topaz aspen
#

so you have your project with some remote, and the upstream is the original project - iiuc

leaden tartan
#

yeah, and origin is "YourUsername/Project"

topaz aspen
#

right, makes sense

heady nexus
#

im getting started in Python, is PyCharm Professional all that good?

tawdry needle
#

Start with the community version if you are new to python. Not worth the paid upgrade unless you are literally a professional, at which point your employer should pay for it

obtuse rapids
#

im getting started in Python, is PyCharm Professional all that good?
@heady nexus Also depends what you do with it. Personally, for web dev, I find VSCode handles Docker and Vue.js better.

red lion
#

Hello I want to learn Python so Can you introduce some document for me?

leaden tartan
red lion
#

thanks

leaden tartan
#

@obtuse rapids Sorry to trouble you, but can you tell me whats happening here?
I can not contact my backend from the frontend service but can do so viceversa

# frontend
root@d03d3775ebe8:/app# ping backend:8000
ping: backend:8000: Name or service not known
/app # ping frontend:3000 -c 1
PING frontend:3000 (172.18.0.4): 56 data bytes
64 bytes from 172.18.0.4: seq=0 ttl=64 time=0.142 ms

--- frontend:3000 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.142/0.142/0.142 ms
#

!paste

rancid schoonerBOT
#

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.

leaden tartan
#

docker compose for reference https://paste.pythondiscord.com/matucaxise.http

@obtuse rapids Sorry to trouble you, but can you tell me whats happening here?
I can not contact my backend from the frontend service but can do so viceversa

# frontend
root@d03d3775ebe8:/app# ping backend:8000
ping: backend:8000: Name or service not known
/app # ping frontend:3000 -c 1
PING frontend:8000 (172.18.0.4): 56 data bytes
64 bytes from 172.18.0.4: seq=0 ttl=64 time=0.142 ms

--- frontend:8000 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.142/0.142/0.142 ms
obtuse rapids
#

@leaden tartan ping requests are sent using the ICMP protocol, that doesn't use ports, unlike TCP/UDP.
Try just the service name: ping backend

leaden tartan
#

alright, looks like I will have to look into network protocols next. Thanks

marble beacon
#

Hello, can anyone help me with connecting to google directory via python? I would want to list the objects and their properties to do some cleaning

flint fog
#

Hey,So Im running Python on Atom
I wrote a Script that would give me a .PPM file,how would I see that file

#

Is there a Command Line or Terminal or something

leaden tartan
flint fog
#

Yeah,I know what a .PPM file is,but Im wondering where I can access it

#

Oh,Nvm

#

Yeah,Im running Manjaro Linux,and for some reason while searching for test.ppm,It didn't show up

modern lance
#

Hi guys, I'm using Github official library to get the info about all the repositories in my organization and right now I just want to label every repository somehow

#

Is it possible to do? I saw labels and tags for commits, but not for the whole repos

warm pollen
#

I think they are called topics, but I don’t see it in the API docs, I’m guessing that you can’t modify it using the library too

modern lance
#

Okay, thanks!

leaden tartan
#

I am running my django webserver using docker. Everything works fine as expected but the problem is when I upload an image (for eg using the Django Admin), the files are created with rootpermissions inside my docker containers. This makes them unreadable (and undelete-able) to my host machine, since I have a shared volume on my project.

/app/media/images/posts/2 # ls -lR
.:
total 8
-rw-r--r--    1 root     root          7575 Sep 14 15:55 download.jpeg
#

I suppose there is something wrong with my Dockerfile?

#
FROM python:3.8.5-alpine

EXPOSE 8000

ENV PYTHONDONTWRITEBYTECODE 1 \
    PYTHONUNBUFFERED 1

WORKDIR /app

ENV SECRET_KEY=e75)h*54#&*^&(secret-keyd+=^%mb0n \
    SQL_USER=user \
    SQL_PASSWORD=unip69204passwd \
    SQL_HOST=database \
    SQL_PORT=5432 \
    SQL_ENGINE=django.db.backends.postgresql \
    SQL_DATABASE=db

# install psycopg2, pillow and argon2_cffi dependencies
RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev libffi-dev openssl-dev jpeg-dev zlib-dev

COPY . /app/
RUN pip install -r requirements.txt
obtuse rapids
leaden tartan
#

this is not for production ofc, I have shared volumes locally to take advantage of django's stat reloader. That being said, thank you @obtuse rapids

obtuse rapids
#

Then yes, match your user id to the one in docker πŸ˜€

leaden tartan
#

I looked into the repo for a bit, I still couldn't understand- why exactly are you using supervisord?

maiden zealot
#

Is anyone really familiar with using pexpect? I'm trying to parse output of a sudo systemctl status <service> call on a remote Raspberry Pi, but I think my encoding might be off. I set it to 'utf-8', but the output looks like garbage when I print output from systemctl status, perhaps because of the special characters being used and colorized output?

#

I'm simply trying to expect "Waiting for client connections" but it's not finding it for whatever reason

#

Oh gosh, I'm an idiot... s.expect('Waiting for client connection') is finding it so it's working... however, I guess my question still stands as to why terminal jumps all over the place and whatnot

obtuse rapids
#

I looked into the repo for a bit, I still couldn't understand- why exactly are you using supervisord?
@leaden tartan not strictly necessary, but it is the recommended setup for Django Channels, that I plan on implementing (https://channels.readthedocs.io/en/latest/deploying.html).

#

It does have some advantages, e.g. restarting the server if it goes down for whatever reason.

#

If you notice, I am running daphne, which is an async server.

steep sun
#

hello, I'm looking for someones creative input. I'm building my own smarthome controller. I have multiple classes controlling various things, Hue lights, computer on/off and more. What I need is a state controller. One that maintains differences between actual states of eg. a light, and the expected state. So I in code, can resend a command, if say a light doesn't match the desired state.

#

I have a hard time wrapping my head around, what the smartest way of keeping track of various states, other than hardcoding variables in each class for expected state / actual state (updated from the api's).

maiden zealot
#

@steep sun how are your devices communicating? are they already using MQTT or LwM2M or something?

#

that might dictate an off the shelf "controller" that you decide to use

steep sun
#

my setup is like so: 1x jetson nano running code, that communicates to various device controller API's.

#

I think I just wrote a state controller, can you have a look and see if it's pythonic ?

maiden zealot
#

Eh.. you probably don't want me deciding what is idiomatic Python code πŸ˜›

steep sun
#

hehe fair enough

#

dont care about that actually

#

just care about a second opinion

maiden zealot
#

I'm a C programmer, but trying to use pytest to automate some test stuff.. I'm a terrible python programmer compared to someone that does it every day πŸ™‚

steep sun
#

okay, then it'll probably weird you out, anyways, the idea was that I created a class, that I can register values towards.

#

so I can say states.add("office_lamp",["on","brightness"])

#

it then creates a dict entry, with entries for on and brightness along with "actual" vs "expected" values of those.

#

then from my API communication part, I can set states.set("office_lamp","actual","on",True)

#

from my actions part I can say states.set("office_lamp","expected","on",False)

#

Then I can have code, that monitors for deviations and correct the actual states to match, between expectation and actual states of the devices controlled.

#

if that makes sense

maiden zealot
#

Yeah, I think. I don't know if this helps @steep sun , but this sounds like you want to maintain a digital twin like representation of your devices. Azure IoT has a digital twin service and AWS IoT calls this device Shadow. you may be looking for an open source equivalent.

From my limited experience, in the cloud services, you could query for a device twin and you'd receive a JSON representation of the device as a response. This JSON packet would have a bunch of key-value pairs sorted in to "reported" (as last reported by the device) and "desired" (as requested by some application). Some middleware could worry about syncing the desired state to the device when its online which would trigger an update of the reported state, etc...

steep sun
#

ahh, sweet .. something to read into. and those namings "reported" and "desired" actually sound better than "actual" and "expected".

#

thanks man

#

ShadowTwin

#

Going to call my class that

#

Sounds powerful

maiden zealot
steep sun
#

I just wrote my own

#

Will check up on the link

#

I like to write my own stuff.

#

Not because I think I'm better, but to learn.

maiden zealot
#

yeah, makes sense

#

good luck

#

πŸ™‚

steep sun
#

Thank you and thanks for your input

#

You have changed my code πŸ˜‰

broken eagle
#

I'm currently using Pycharms to run unittests with coverage. The interpreter is a docker container that has a pipenv setup inside.

#

When I try to run coverage, it is informing me that I don't have coverage installed. However, it is in the Pipfile that I have setup both on the local host and the container itself.

#

Any ideas where I might be missing something?

#

Run it with bundle works

obtuse rapids
#

When I try to run coverage, it is informing me that I don't have coverage installed. However, it is in the Pipfile that I have setup both on the local host and the container itself.
@broken eagle What does your Dockerfile look like?

carmine pulsar
#

I want to take an arbitrary Git clone URL, give it to GitHub when creating a new repository, and have GitHub git pull the repository regularly, e.g. daily.

For example, a https://github.com/aosp-mirror AOSP mirror which fetches/pulls every sometime automatically from original source.

heavy knot
#

when i want use python with vscode, do i just download it?

#

or i must install additional extensions?

obtuse rapids
#

You can just download VSCode, but I highly recommend installing the official Python extension from Microsoft...

#

Along with Flake8 and Black.

heavy knot
#

what is the flake8 and black?

obtuse rapids
#

Yup, that's the one.

#

black is an automatic code formatter. You can configure vscode to run it whenever you save a python file, and it will automatically format your file in a pre-defined way.

#

It doesn't let you change the rules much, but at least your code will be consistent....

#

flake8 is a linter, which checks for code style in another way (mostly around pep 8).

heavy knot
#

ok thanks, and do you know if pycharm has flake8? because it also has similar feature correct?

#

is that included by default

obtuse rapids
#

Flake8 is an external tool. You can get it in your OS repos sometimes on Linux (e.g. Arch Linux) or from PyPI

#

I think pycharm supports is, but I am not really a fan of pycharm.

#

For Web Dev, VSCode fits my needs a lot better.

heavy knot
#

ok well let me try this, and thanks!

heavy knot
#

is there a way for auto complete to add brackets when you select function in vscode?

leaden tartan
#

@heavy knot set python.autocomplete.addBrackets: true in your settings.json

heavy knot
#

alright thanks πŸ™‚

lime roost
#

Hi

obtuse rapids
#

Hi
@lime roost Hi. Did you have a question?

inner pollen
obtuse rapids
#
# __init__.py
from .pyytdata import PyYtData
#

Then you should be able to do from pyytdata import PyYtData

inner pollen
#

sure thing.

obtuse rapids
#

Honestly not a big deal....

#

But it looks cleaner πŸ™‚

inner pollen
#

Honestly not a big deal....
@obtuse rapids can you suggest something to add and improve.

obtuse rapids
#

Kinda curious why util is in the root and not a subdirectory of pyytdata

inner pollen
#

Ok, I will move it inside the subdirectory.

obtuse rapids
#

Never mind, I'm a fucking idiot and this compose file was already version 2 lol

sand thistle
#

so im having a weird issue

#

i just did a git fetch

#

and now when i try to run my code it's telling me i have syntax errors

#

but the syntax is fine

#

I think it's because im having an error on an fstring

#

but i had something weird happen too... where it was flagging some code that didn't exist anymore. a typehint

urban kestrel
#

Hey I got a simple question for anyone who used PyCharm Edu, I'm currently running it on an ubuntu VM if it matters.

I made it so that run works on F4 however if i work on multiple files and i specifically want to run something on the current window, pressing F4 doesn't actually run it and I'm forced to right click the file in question and run it from there if I want F4 to start working there or else it will keep running the previous program.

How do I change it so that it will run the window I'm currently working on?

soft vigil
#

what's devops?

tawdry needle
#

"developer operations", things like setting up automated testing infrastructure, source code version control, etc.

sand thistle
#

what do you guys preffer

#
                araxis
                emerge
                opendiff
                vimdiff
                vimdiff2
                vimdiff3
tawdry needle
#

osx opendiff is quite nice

#

ive never used araxis

#

emerge is emacs and im not an emacs user so i dont use that, but its probably good if you are an emacs user

#

vimdiff is similar, use it if you really like vim

sand thistle
#

welp i use nano

#

so

#

:/

#

doing a brief google now between the 3

#

i know it's a simple quick editor, which is why i picked it up. but im at a point where I should probably pick a more complex editor. Since nano is actually not that good.

#

i will probably gravitate towards vim

leaden tartan
#

@sand thistle or just use vscode. i use vim only for commit messages and when I need to make very minor changes somewhere and I'm too lazy to open up vscode.

sly sleet
#

lmao I use nano for any console editing

leaden tartan
#

yeah nano is pretty fine, but vim is a lot more powerful, especially with its easy navigation system

#

vscode trumps them both tho

smoky compass
#

When installing local packages with pip is there a "good" way to make pip indicate that they're locally sourced, which doesn't involve -e? I have code in packages locally but I don't want them to be editable. However if I do pip install ./mypackage it just shows as mypackage==1.0.0 in a requirements.txt which makes installing it fail

restive moth
#

how do I share my code to others so they can use them like apps

#

i went to help channel

#

they sent me to advanced discussion

#

they sent me here

sand thistle
#

i was curious, what is best practices for collaborating on a git repo

#

should everyone be doing pull requests?

#

or do people just pull, code, then push

supple venture
#

can i open jupyet notebooks with pycharm, or i have to add an extension to do so?

obtuse rapids
#

should everyone be doing pull requests?
@sand thistle PRs are the standard, yes.

#

I just git rebase master onto feature branches because merges are lame but most people don't like that

#

how do I share my code to others so they can use them like apps
@restive moth push it to a git repo (like GitLab).

#

Is it python? You can also package it using e.g. poetry and publishingit on PyPI.

warm pollen
#

most people don't like that
I want some numbers, sir!

obtuse rapids
#

Akarys don't like that πŸ˜…

leaden tartan
#

I just git rebase master onto feature branches because merges are lame but most people don't like that
@obtuse rapids Rebases are cool. Normal merges don't make any sense further down the road, some time later

supple venture
#

can i open jupyet notebooks with pycharm, or i have to add an extension to do so?
@supple venture jupyter*

sand thistle
#

so why rebase vs merge

obtuse rapids
#

Because you end up with 20-40% of your commits just being "merged branch foo" πŸ’©

#

And your histograph is full of branches.

#

Rebase gives you a linear history.

#

I prefer it, but it doesn't mean that it's better /right.

eternal flicker
#

another way to look at it is merge preserves history, but rebase rewrites, so the latter isn't encouraged for public branches

tawdry needle
#

i dont think theres anything wrong with "merged branch foo" commits @obtuse rapids

#

history is history

quaint saffron
#

can i open jupyet notebooks with pycharm, or i have to add an extension to do so?
@supple venture this is only possible with the professional (paid) version iirc

supple venture
#

ah, sad

obtuse rapids
#

i dont think theres anything wrong with "merged branch foo" commits @obtuse rapids
As I said, personal preference :)
I have used both (on personal projects and public repos), and find a rebase flow cleaner.
Doesn't mean merge is wrong, of course.

#

ah, sad
@supple venture VSCode can run jupyter notebooks.

supple venture
#

well i am downloading that

#

i don't like going to browser running

leaden tartan
#

Vscode runs jupyter natively. No extra installation

supple venture
#

yes

#

am dowloading the vscode

#

noice got it down

#

thanks

heavy knot
#

Hello, someone created a branch for me on gitlab and wanted me to use the git checkout command to work in that branch. Can someone help me with this? I’m not really familiar with gitlab

#

I have my source code currently on my laptop and gitbash/windows power shell installed but don’t know what exactly to do

leaden tartan
#

@heavy knot Just git checkout <branch-name>

heavy knot
#

Thanks Ignis, do I do that in git bash or where?

#

Or windows powershell

leaden tartan
#

both will work, but I suggest git bash @heavy knot

heavy knot
#

Ok, sorry just one more thing, I’m getting a fatal: not a git repository

#

When I try that in either one

leaden tartan
#

Ok, sorry just one more thing, I’m getting a fatal: not a git repository
@heavy knot You are probably not in the correct directory

#

If you saved the repo to Desktop, you need to navigate to it

#

cd path\to\Desktop

heavy knot
#

Thanks a lot bro πŸ™‚

leaden tartan
#

When I do docker-compose up -d locally, all the services are created and work as expected. But when I run this on CI (travis), only one service (out of three) is created. Any idea why this happens?

obtuse rapids
#

When I do docker-compose up -d locally, all the services are created and work as expected. But when I run this on CI (travis), only one service (out of three) is created. Any idea why this happens?
@leaden tartan check the Travis logs?

#

And if you can / necessary, ssh into the server, and check docker logs

leaden tartan
#
igfrontendtesting_1_adf2212ada60 | Cypress could not verify that this server is running:
igfrontendtesting_1_adf2212ada60 | 
igfrontendtesting_1_adf2212ada60 |   > http://igfrontend:3000
#

This is quite weird

obtuse rapids
#

Hmmm.... maybe it's starting too early?

leaden tartan
#

No its not

#

Since I am running the entire backend test suite prior to this that takes about 5 minutes

obtuse rapids
#

What is your front-end running? nginx, or node?

leaden tartan
#

node

obtuse rapids
#

Which service is running? Back-end?

leaden tartan
#

Looks like I have to email the travis ci customer support for ssh access

#

Which service is running? Back-end?
@obtuse rapids django drf- manage.py runserver

obtuse rapids
#

So igfrontend service isn't running either....

#

You need to figure out why.

#

Probably why the test container isn't either.

leaden tartan
#

Yeah, the problem is it runs on mine

obtuse rapids
#

Does Travis not say anything about igfrontend?

leaden tartan
#
Creating network "uni_default" with the default driver
Creating uni_igdatabase_1 ... done
Creating uni_igbackend_1  ... done
Creating uni_igfrontend_1 ... done
#

This is what the output is locally

#

On travis

Creating network "uni_default" with the default driver
Creating volume "uni_backend" with default driver
Creating volume "uni_frontend" with default driver
Creating volume "uni_postgres_data" with default driver
Creating unix_igdatabase_1_338aebc4e7d8 ... 
#

So only database is created- both frontend and backend are not

#

The backend isn't a problem right now since the cypress tests are very useless and only test display: none; etc

#

But that would be a problem soon too once the cypress tests are a bit more extensive

obtuse rapids
#

Throw your travis and docker-compose config in here?

#

At least travis to start

leaden tartan
#
sudo: required
language: node_js
node_js:
  - 14.8.0
services:
  - docker
before_script:
  - docker-compose -f docker-compose.yml -f docker-compose.test.yml build
  - docker-compose -f docker-compose.yml -f docker-compose.test.yml pull
script:
  - docker-compose up --detach
  - docker-compose -f docker-compose.test.yml run --entrypoint "pytest --flake8" igbackendtesting
  - docker-compose -f docker-compose.test.yml up --exit-code-from igfrontendtesting igfrontendtesting
after_script:
  - docker-compose down -v --remove-orphans

notifications:
  email: false
#

I should probably remove sudo: required

obtuse rapids
#

Maybe you need a docker-compose down before you docker-compose up?

#

Maybe you have containers running from a previous commit.

leaden tartan
#

Commit to what? Travis doesn't cache anything. Are you talking about docker?

#

I'll add it anyway, and check what happens

obtuse rapids
#

Oh.... Well, does it ever stop though?

#

I'm not familiar with Travis, TBH. I run my own gitlab-runner on my own server.

leaden tartan
#

Yeah it does stop due to the after_script thingy

#

but it fails obviously

obtuse rapids
#
after_script:
  - docker-compose logs igfrontend
  - docker-compose down -v --remove-orphans
#

add a logs command.... it should tell you wtf the node image is doing

obtuse rapids
#

@ me when you have an update πŸ™‚

leaden tartan
#

@obtuse rapids the build keeps hanging idk why. I'll get back to you once I fix it. I probably made too many requests today thats why it keeps hanging :/

obtuse rapids
#

No worries

sand thistle
#

so do you guys ever just

#

read digital ocean tutorials and then take the code and make a shell script

#

cuz i have the urge to make shell scripts out of these tuts

#

vault.service: Main process exited, code=exited, status=213/SECUREBITS

#

crap

#

bruh

#

Loaded: loaded (/etc/systemd/system/vault.service; disabled; vendor preset: enabled) disabled vendor O.o that don't sound right

sand thistle
#

vault is beating me up

sand thistle
#

hashicorp vault *

heavy knot
#

is there any cross platform apps for saving/importing and viewing docs offline? would like to be able to visually browse and click around the docs without having an internet connection.

smoky compass
#

@heavy knot If you mean like Github then I think Github Desktop lets you view your local repos offline

heavy knot
#

more like the python docs themselves, and other project docs on things like read the docs

#

i'll have a look at github desktop though

jovial hound
#

can someone help me convert python script to exe file

heavy knot
pallid jacinth
#

I dont know how to install it

pallid jacinth
#

Hello?

#

Is anybody there?

leaden tartan
#

@pallid jacinth there is a file called INSTALL in that repo.

#

the instructions look simple enough

pallid jacinth
#

I tried them

leaden tartan
#

ohh

#

any particular error?

pallid jacinth
#

I did make install

#

the last command

leaden tartan
#

what's the output?

pallid jacinth
#

No module named PyQt5

#

The installtion went fine

leaden tartan
#

pip install -r requirements.txt

pallid jacinth
#

This error comes when I try to runapt-offline-gui

#

bash: pip: command not found

#

How to install pip?

#

sudo apt install pip?

leaden tartan
#

don't you have python installed?

pallid jacinth
#

yes I have

#

Python 2.7.18rc1 (default, Apr 7 2020, 12:05:55)
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

#

How to install pip?

leaden tartan
wooden ibex
#

PyQT5 probably requires python 3

leaden tartan
#

also your python is very old, upgrade to 3.8

pallid jacinth
#

ERROR: Could not find a version that satisfies the requirement magic (from -r requirements.txt (line 4)) (from versions: none)
ERROR: No matching distribution found for magic (from -r requirements.txt (line 4))

#

oh ok

leaden tartan
#

ERROR: Could not find a version that satisfies the requirement magic (from -r requirements.txt (line 4)) (from versions: none)
ERROR: No matching distribution found for magic (from -r requirements.txt (line 4))
@pallid jacinth probably cause you're using an outdated version of python

pallid jacinth
#

How to upgrade?

leaden tartan
#

you're on Ubuntu?

pallid jacinth
#

sorry I am a bit new

#

linux mint

#

based on ubuntu

wooden ibex
#

It’s python3 most likely

hollow rose
#

is this the right channel to ask help on a library?

umbral widget
#

I need a bit of help rebasing git. I accidentally commited a credential file (locally only), subsequently moved it around with a couple of --fixup commands without realising it was in there. Then I finally tried to remove it with a final --fixup and rebase.

#

I've ended up with a merge conflict I don't know how to resolve.

obtuse rapids
#

I need a bit of help rebasing git. I accidentally commited a credential file (locally only), subsequently moved it around with a couple of --fixup commands without realising it was in there. Then I finally tried to remove it with a final --fixup and rebase.
Make a new branch (git branch -b backup), checkout the branch you have problems with (git checkout master or whatever instead of master), and rebase interactively the last N commits (git rebase -i HEAD~5 to edit the last 5 commits).

#

You can then undo the commits you don't want.

#

Another option is to branch from an earlier commit, and redoing your work.

umbral widget
#

Thanks - didn't occur to me to just back up the working directory and just restore files back

sand thistle
#

has anyone used hashicorp vault

wooden ibex
#

We have it at work

sand thistle
#

I'm having difficulties setting it up on my server

#

do you have some time to help?

wooden ibex
#

no

sand thistle
#

I'm not sure that I've configured things correctly

wooden ibex
#

their APIs are documented very well

sand thistle
#

ha ok well at least you're honest

wooden ibex
#

so RTM

sand thistle
#

thanks...

#

this is my first deployment, and linux isn't my speciality

wooden ibex
#

Are you trying to deploy it?

sand thistle
#

i have some software running on a server

#

I've installed the vault

#

I can run it in dev mode

#

but it's likely the config file that is incorrect

wooden ibex
#

I don't deal with that

sand thistle
#

k

barren shale
#

im getting an error while installing dlib in windows 10

#

@everyone its saying wheel error

#

can someone help

wooden ibex
#

<@&267629731250176001> advertising

harsh panther
#
default_language_version:
  python: python3.7
fail_fast: true
repos:
-   repo: https://github.com/ambv/black
    rev: stable
    hooks:
    -    id: black
-   repo: https://github.com/PyCQA/flake8
    rev: master
    hooks:
    -    id: flake8
-   repo: https://github.com/pre-commit/mirrors-pylint
    rev: master
    hooks:
    -   id: pylint
        files: coc
#

i have .pre-commit-config.yml

#

but its not getting triggered

#

its installing .git\hooks\pre-commit

sage cradle
#

@gilded horizon advertisements aren't allowed in this server

harsh panther
#

instead of .pre-commit-config.yml

#

any idea y this happening

#

please ping me when someone answer

wooden ibex
#

I don't know hooks all that well

harsh panther
#

i wnt to install this .pre-commit-config.yml

#

but its installing default pre-commit hook

tidal solstice
#

How to make app like vitetris using python i.e. some gui on terminal

sly sleet
#

@tidal solstice curses

obtuse rapids
#

How to make app like vitetris using python i.e. some gui on terminal
@tidal solstice second curses. Also, wrong channel. #user-interfaces would probably be better. Maybe #unix .

ocean wharf
#

Hi I am doing the Automate the Boring Stuff for Python course and looking for the next stepping stone after this course. Appreciate more course and project/practice recommendations. Thanks!

proud trout
tawdry needle
#

@ocean wharf Practical Python is another beginner course, but it's more "precise" and focused on python itself rather than "how to do things with python", so it might help to at least skim its content

ocean wharf
#

@proud trout I will try those communities. I was sent here. Thanks for help!

#

@tawdry needle I will look at Practical Python. I was looking more for automation specific courses but regardless I will check out that course.

obtuse rapids
#

I will look at Practical Python. I was looking more for automation specific courses but regardless I will check out that course.
@ocean wharf what are you trying to automate?

ocean wharf
#

I do not have a project in mind. I maybe will think of a project where I can implement the skills I learned in the Automate The Boring Stuff course. New to automation world

#

@obtuse rapids

obtuse rapids
#

Haha, ok. I would recommend thinking of things you would like to automate, and learn that.

#

Do you work with software?

#

Or hardware?

ocean wharf
#

I do not work yet

#

Still a college student

obtuse rapids
#

Studying a specific discipline?

ocean wharf
#

Cyber Criminology

obtuse rapids
#

Maybe web scraping would be a good thing to study next, then.

#

Selenium, requests, etc.

ocean wharf
#

Okay I will look into all of this. Thank you for recommendations. @obtuse rapids

dense needle
#

hello, I am currently on python 3.8.2 - 64bit, using PyCharm as my IDE, with Anaconda3 -64bit installed. I've been trying to install the tensorflow package onto my IDE, but I got this error message:


If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

The following specifications were found to be incompatible with your CUDA driver:

  - feature:/win-64::__cuda==10.0=0
  - feature:|@/win-64::__cuda==10.0=0

Your installed CUDA driver is: 10.0```

I have pip installed, and I've tried installing other packages such as matplotlib, panda, etc, but the tensorflow package won't download. I've tried searching on Google for answers, and have changed my project interpreter to Anaconda, with the base interpreter being from Anaconda3\python.exe. 

I'm not sure if this is enough information, but thank you in advance for any help.
sand thistle
#

has anyone used docker-compose file to manage secrets

obtuse rapids
#

has anyone used docker-compose file to manage secrets
@sand thistle I do.

#

Well, with environment variables and Gitlab-CI.

sand thistle
#

oh i was advised to place my secret key into a docker-compose file and add the docker-compose file to the .dockerignore file, so that the secret won't be pushed to dockerhub

#

but won't that just mean that when i deploy this to my server, the image wont contain the secret O.o

obtuse rapids
#

oh i was advised to place my secret key into a docker-compose file and add the docker-compose file to the .dockerignore file, so that the secret won't be pushed to dockerhub
@sand thistle very odd. Normally, you don't hardcode it in docker-compose.yml at all.

#

But I also don't push my images to dockerhub ... they go to a private repo in my gitlab.

sand thistle
#

Yeah so I have a private repo

#

But the webhooks connected to the docker hub

#

So I push to repo and it auto builds an image

left mulch
#

What can I do to improve the quality and comprehensiveness of autocompletion suggestions in Visual Studio Code?
I find them very useful when learning a new language. I tried switching to Microsoft Python Language Server and installing IntelliCode extension. They got better at detecting types and proposing methods, but they are still lacking (for example with arguments / flags).

errant ether
#

What is a great article on unit testing with python?

#

Well written one mind you

frigid stirrup
#

Hello, I need some help, I am getting this error while doing pipenv install. I've already set the path

#

I am currently running Python 3.8.5

sand thistle
#

But I also don't push my images to dockerhub ... they go to a private repo in my gitlab.
@obtuse rapids so then I see you're storing it in variable format where is the actual value for the django secret key stored DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY}

frigid stirrup
#

I could solve the problem, but I'd like to know why I had to run pipenv --python 3.8 in my case for it to work

#

Every search in Google said it had to be pipenv install

flint badge
#

Hi, I've never gotten this message when i've made a commit in the pawst.

  1. Why would this occur?

  2. Should I suppress it? or what should I do?
    [master 189a579] Content is showing over the foreground image, but footer is still risng above overflowing, and content is overlapping strangely.
    Committer: Brian Boros Bpower@tests-MBP.attlocal.net
    Your name and email address were configured automatically based
    on your username and hostname. Please check that they are accurate.
    You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

git commit --amend --reset-author

1 file changed, 1 insertion(+), 1 deletion(-)

wooden ibex
#

I think message is clear

#

what's confusing about it

vague edge
#

hey so sublime text's command palette doesn't accept the "normal" ctrl key (the one on the left of my keyboard)- it only accepts the one on the right- is there a way to remedy this somehow?

#

(ping 2 reply th)

#

x

obtuse rapids
#

@obtuse rapids so then I see you're storing it in variable format where is the actual value for the django secret key stored DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY}
@sand thistle it's in Gitlab. It has its own secrets store (a bit like Hashicorp Vault), and gitlab-runner pulls them automatically.

harsh panther
#

I have question for azure can I use azure for free always I am the only contributor for my repo ,my repo is private

warm pollen
#

Private repos have a limit for sure, a certain number of minutes per month iirc

harsh panther
#

And open source?

#

Is free?

#

And for private repos it is always free?

#

With certain minutes

warm pollen
#

1,800 minutes/month apparently, I’m sure if it has some discount for open source

harsh panther
#

1800 minutes always free?

warm pollen
#

Yup

finite fulcrum
#

It's free for any account with the minutes limit or unlimited for public

leaden tartan
#

1800 minutes is not a lot tbh. especially per month

harsh panther
#

Ty guys I wnt to learn azure in depth can I have some yt linksπŸ™‚

#

Or some useful link which can help

#

Can azure host my bot too?

#

And db

warm pollen
#

Yes, that’s Azure cloud iirc