Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need to commit the dist folder to git in order to be able to install the package using pip from git?

I want to reuse some code for my internal team at work. My plan is to create a package and then have people install the package using pip straight out of our git repo. i.e. as shown here: https://pip.pypa.io/en/latest/reference/pip_install/#git

My question is, do I commit the dist folder to git? What is pip looking for?

Or is there a better way to share / reuse code internally for a team (across many different projects)?

I used a .gitignore file from here (is that github's default Python .gitignore file?) and it ignores all the dist files:

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

but it seems wrong to exclude these from the repo when I'm trying to install from the repo.

like image 480
Dan Avatar asked Dec 06 '17 15:12

Dan


People also ask

How to add a whole folder to commit in Git?

In conclusion, you can add a whole folder to commit in Git. Make sure you are above the folder you intend to add. You can also use the git add command with a dot to add all files in a folder. And when specifying the folder name, use "" if the folder name has spaces.

Should I commit my /vendor folder to Git?

The recommendation from Composer is NOT to commit your /vendor folder and have your deployment process take care of running composer install to grab all your dependancies. I'm coming round to the school of thought that having your /vendor folder in git has some pretty big advantages after reading this article:

How do I commit to a staging area in Git?

Once you're ready to craft your commits, you'll use git add <FILENAME> to specify the files that you'd like to "stage" for commit. Without adding any files, the command git commit won't work. Git only looks to the staging area to find out what to commit.

How do I commit changes to a file in Git?

You can also use a handy command, git add -p, to walk through the changes and separate them out, even if they're in the same file. git commit: This starts the commit process, but since it doesn't include a -m flag for the message, your default text editor will be opened for you to create the commit message.


Video Answer


1 Answers

You do not need to commit the dist folder. pip really just needs the repository to have a setup.py file along with the packages and/or modules you're installing.

like image 69
ldx.a.ldy.c Avatar answered Oct 25 '22 13:10

ldx.a.ldy.c