Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Want to use venv but it's stored in .gitignore as a file not directory? #1184

Closed
3 tasks done
biggestsonicfan opened this issue Oct 24, 2022 · 11 comments
Closed
3 tasks done

Comments

@biggestsonicfan
Copy link
Contributor

Prerequisites

Description

I'm doing a fresh install of my operating system on a new drive and wanted to utilize Python3's venv to run PixivUtil2. While I could put the virtual environment anywhere, I noticed this:

venv is in the ignore list as a file and not a directory? If that's the case, could I have clarification on what this ignore file actually is?

Steps to Reproduce

N/A

Expected behavior:
N/A

Actual behavior:
N/A

Log file:
N/A

Versions

N/A

@biggestsonicfan
Copy link
Contributor Author

Would docker be a preferred over venv in this case? 🤔

@Nandaka
Copy link
Owner

Nandaka commented Oct 26, 2022

hmm, I'm also not sure as it was added in https://github.com/Nandaka/PixivUtil2/pull/1015/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947 by @BassOfBass and I don't use virtual environment

@shinji257
Copy link

.gitignore is only used to determine files/folders that should not be added when submitting a commit to the git repository. If you are wanting to use venv for running PixivUtil2 locally you can ignore that file as it won't apply in that case.

With that said.... I have not tried to do that (yet). I run this on Windows and use the exe builds (and make my own when testing code).

@biggestsonicfan
Copy link
Contributor Author

.gitignore is only used to determine files/folders that should not be added when submitting a commit to the git repository.

I am assuming when migrating from demjson to demjson3, python3's venv came in handy to make sure things worked right. What I would not understand is a file created named venv, but perhaps a folder where dependencies were installed named venv existed that they did not want uploaded, however that's not what the .gitignore is set up for in that case.

@Nandaka
Copy link
Owner

Nandaka commented Oct 27, 2022

hmm, then it should be changed to venv/* instead?

@biggestsonicfan
Copy link
Contributor Author

biggestsonicfan commented Oct 27, 2022

Perhaps it should be removed altogether, because in probably the only circumstance it was needed was in the use case by BassOfBass, in which anyone could create a venv outside the PixivUtil2 folder and use the scripts in it just fine. I was merely confused as it was set up as a file.

@Nandaka
Copy link
Owner

Nandaka commented Oct 28, 2022

not really, the venv folder should not be included into the main repo, right? If you remove it, the venv folder might accidentally added if someone use git add .. It should not affect your local repo.

@Hamuko
Copy link
Contributor

Hamuko commented Oct 28, 2022

Yeah, virtual environments should not be committed and it's a good practice to have some safeguards against it. It's why the GitHub Python .gitignore includes it.

@shinji257
Copy link

With that in mind the venv entry should probably be replaced with this (taken from the previously mentioned link) in order to try and avoid venv from being committed in error.

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

@biggestsonicfan
Copy link
Contributor Author

not really, the venv folder should not be included into the main repo, right? If you remove it, the venv folder might accidentally added if someone use git add .. It should not affect your local repo.

The way it's currently setup, the .gitignore would only ignore venv if it was a file. As others are now pointing out, other .gitignores are properly safeguarding against these folders. I'd like to point out it has been lingering there for over a year without anyone noticing however, so I am doubting we, collectively as PixivUtil2 devs, are using venvs like this, lol.

Nandaka added a commit that referenced this issue Oct 28, 2022
@biggestsonicfan
Copy link
Contributor Author

Done and done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants