This man's brain is running at a frequency that I can't even fathom. Really cool, informative video. Exactly what I'm looking for.
@anthonywritescode3 жыл бұрын
glad it helped!
@WatchNev Жыл бұрын
This was extremely more helpful than dealing with StackOverflow jerks. Thank you for this.
@calmdo-able99252 жыл бұрын
Legendary, as basic as this is, it was something I was looking for. Top lad
@MrOxfordАй бұрын
@anythonywritescode I liked this video and thought that you did a great job explaining how to do the setup file. I look forward to watching more of your content and learning how to package software correctly.
@ericng88072 жыл бұрын
Great tutorial! It helped me setup this program called babi
@tombra4ril3 жыл бұрын
Thanks man this was very cool and informative.
@ajinkyarathod51803 жыл бұрын
First I saw the video for 2 minutes, then I realized I also need to watch other things other than the keyboard. So I came to comment this and will continue the video again
@ulfgj3 жыл бұрын
at first, i though he was gonna make one project with the left hand and another with the right hand at the same time.... bummer.
@anthonywritescode3 жыл бұрын
hah! at one point I learned one-handed touch typing -- could get almost ~60 wpm (left hand only)
@jspreddy4 жыл бұрын
I am new to python and am trying to get up to speed on it. I understand that we could re-write a setup.cfg file easier than setup.py file, but why would we need to programmatically re-write this data in the first place? Maybe a few example cases when we would need to change this data would be helpful.
@anthonywritescode4 жыл бұрын
github.com/asottile/setup-cfg-fmt has a few good examples, basically if you want to format or normalize or automatically improve the setup metadata it'd be impossible with setup.py
@guntbert97094 жыл бұрын
Thx again - these "small" examples/tips are right what I need :thumbsup: ! What is the reason for using `exit(main))` instead of just `main()` in main.py?
@anthonywritescode4 жыл бұрын
I cover that in this video: kzbin.info/www/bejne/qaeXZ2VvabGihpo -- it doesn't make any difference in this particular example though
@guntbert97094 жыл бұрын
@@anthonywritescode got it :-))
@jfk13372 жыл бұрын
Do you know about poetry and what do you think about such tools? And for the find packages in setup.cfg you can specify where to look, so you could do a src directory where you put your package( s) , no meed to exclude any new or other folders like docs etc.
@anthonywritescode2 жыл бұрын
yes, I know about poetry and the 3-4 similar tools. imo they slow down development more than helping it and poetry in particular has some very harmful opinions about versioning that make library development an absolute pain
@jbrnds3 жыл бұрын
How would you deal with automating the version in the setup.cfg when building the package if you’d have the version defined somewhere in an / __version__.py or similar.
@anthonywritescode3 жыл бұрын
imo don't bother, you _rarely_ need it at runtime and if you do you can retrieve it using `importlib.metadata.version('pkgname')`: kzbin.info/www/bejne/mJaneGl_l9RlsLM
@scillabiffolia43773 жыл бұрын
what is the blue icon ad on you have in your browser. how about the one next to it?
@anthonywritescode3 жыл бұрын
that's probably bitwarden (password manager) and tampermonkey (user scripting engine)
@chepecarlo3 жыл бұрын
Gracias me ayudó mucho gracias
@anthonywritescode3 жыл бұрын
¡de nada!
@BullishBuddy Жыл бұрын
life saver!
@brainmri3 жыл бұрын
A short tutorial on pyscaffold package will be helpful. Could you do one please? Thanks.
@anthonywritescode3 жыл бұрын
I've never used it personally -- I usually just use `cp` to make my new projects
@anand9673 жыл бұрын
If we want to declare two setup package in setup.cfg how can we do it. As it will have two "name,version,etc.
@anthonywritescode3 жыл бұрын
in that case you'd probably have two setup.py files (containing the `name` / `version`) that share the `setup.cfg`? seems a little bit of a weird setup though :thinking:
@RuslanKovtun Жыл бұрын
Link to "pyproject.toml explained" is missing (:
@anthonywritescode Жыл бұрын
yeah, I don't use it and don't recommend it
@lonterel4704 Жыл бұрын
@@anthonywritescode why dont you like static project metadata in pyproject.toml? Even using setuptools, which is already supporting PEP621. Just curious
@vandykfernandes835611 ай бұрын
Hi. Nice tutorial, how do we handle custom commands via cmdclass in setup.cfg?
@anthonywritescode11 ай бұрын
it doesn't support it -- for any non simple things you need to write them in setup py. it's a nice forcing function though
@vandykfernandes835611 ай бұрын
@@anthonywritescode Okay, but am not understanding how it would work in python 3.12? Python now raises deprecation warnings for setuptools and calling setup.py installs. If I write it in setup.py won't it be an issue in future? Or is there a way to call commands in setup.py with pip install?
@anthonywritescode11 ай бұрын
setuptools is not deprecated, nor is setup.py -- the communication on this is terrible from pypa and it's leading to all sorts of misunderstandings. the things that are deprecated are distutils and calling setup.py directly. pip will do the right thing though
@vandykfernandes835611 ай бұрын
Following is the warning I see, SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
@vandykfernandes835611 ай бұрын
@@anthonywritescode Got it, maybe I explained myself poorly, if calling setup.py directly is deprecated and if I have custom cmds in my setup.py how do I call it without setup.py. Right now what we do is `python setup.py mycustomcommand` how should it be called when setup.py won't be allowed to be called directly?
@manoharkulat56142 жыл бұрын
hi atually I passed -e . in requirements.txt but I am getting ERROR: File "setup.py" no found.Directory cannot be installed in editable mode.
@anthonywritescode2 жыл бұрын
well, did you read what the error message says?
@Flyingnobull2 жыл бұрын
Thanks!
@Flyingnobull2 жыл бұрын
Wouldn't able to fix the issue without seeing the commas you added at setup.py script. - Thanks!
@meeexy116 Жыл бұрын
how do you include stub (.pyi) files in the package with setuptools
@anthonywritescode Жыл бұрын
check out these: - kzbin.info/www/bejne/mJfceqWOacSsgpo - kzbin.info/www/bejne/pGWqe2uopZt3pqc
@geekchiq5431 Жыл бұрын
Python "package" - giggity
@PritishMishra3 жыл бұрын
Good !!
@talalkalai87482 жыл бұрын
Can u make a video explaining pkg versions in setup, specifically __version__.py file. Ive noticed both pytest/requests using it , but couldnt figure out the right way. (have a pr on the line here...)
@anthonywritescode2 жыл бұрын
they're using setuptools-scm which I do not recommend -- I talk about semantic versioning here: kzbin.info/www/bejne/rIO2qGWcaJmFiLc and I just write the version directly in setup.cfg as I show in this video
@talalkalai87482 жыл бұрын
@@anthonywritescode would you recommend shifting to pyproject.toml?
@anthonywritescode2 жыл бұрын
I'm not using it
@prafullakh2 жыл бұрын
Please help me understand the following Python behavior: def foo(): x = 1024 my_list = [1024] def helper(): x = 2048 my_list[0] = 2048 return helper() print(x) # Stuck at 1024 😞 print(my_list[0]) # Changed to 2048 🙂 return foo() Thanks!
@anthonywritescode2 жыл бұрын
sure! check out this video where I explain what's going on here: kzbin.info/www/bejne/m6e8gJ-KZrlqg9E
@prafullakh2 жыл бұрын
@@anthonywritescode Thank you very much. This really helped.