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

Add .gitignore and init git repo for taipy cli #671

Open
toan-quach opened this issue Jan 12, 2024 · 15 comments · May be fixed by #1247
Open

Add .gitignore and init git repo for taipy cli #671

toan-quach opened this issue Jan 12, 2024 · 15 comments · May be fixed by #1247
Assignees
Labels
good first issue New-contributor friendly 📈 Improvement Improvement of a feature. 🟩 Priority: Low Low priority and doesn't need to be rushed 🥶Waiting for contributor Issues or PRs waiting for a long time
Milestone

Comments

@toan-quach
Copy link
Member

When using django cli or reactjs cli to generate a project, it always comes with a folder that already has git initialized along with a .gitignore. This is very convenient to have in taipy cli as well

@toan-quach toan-quach added Core Related to Taipy Core 🟧 Priority: High Must be addressed as soon 📈 Improvement Improvement of a feature. labels Jan 12, 2024
@jrobinAV jrobinAV added 🆘 Help wanted Open to participation from the community and removed Core Related to Taipy Core labels Jan 12, 2024
@jrobinAV jrobinAV removed the 🆘 Help wanted Open to participation from the community label Jan 25, 2024
@jrobinAV
Copy link
Member

jrobinAV commented Jan 25, 2024

We need to list the file patterns to be in the .gitignore:

EDITED:
Add the version generated by GitHub + .taipy, .data, user_data

@trgiangdo trgiangdo added 🟨 Priority: Medium Not blocking but should be addressed and removed 🟧 Priority: High Must be addressed as soon labels Jan 26, 2024
@jrobinAV jrobinAV added the Core Related to Taipy Core label Mar 8, 2024
@jrobinAV
Copy link
Member

jrobinAV commented Mar 8, 2024

The .gitignore should be added to the default template.

@jrobinAV jrobinAV added 🟩 Priority: Low Low priority and doesn't need to be rushed good first issue New-contributor friendly and removed 🟨 Priority: Medium Not blocking but should be addressed labels Mar 8, 2024
@trgiangdo trgiangdo added this to the Community 3.2 milestone Mar 22, 2024
@anunayasri
Copy link

Hi @jrobinAV I want to work on this. I have setup the codebase and am exploring it further. Can you point me to the entrypoint to taipy cli please.

@toan-quach
Copy link
Member Author

toan-quach commented Apr 12, 2024

Hi @anunayasri ,

The entry point to the CLI would be in the taipy/_cli folder. However, I believe this issue is looking to develop a default .gitignore and initiate a git repo for the to-be-created Taipy project through Taipy template. So it might be to your interest to have a look at Taipy template at taipy/templates as well :D Do let me know if you have further questions!

Thanks for supporting us and giving us a helping hand!!!

@anunayasri
Copy link

Hi @toan-quach.

Thanks for the response and for correcting me. I need one more help please. I am trying to run the taipy cli. For some reason, pip install . doesn't create an executable in the venv's bin folder. Taipy is installed only in site-packages folder. Any leads on how to resolve it? Ultimately I want to run taipy create --template <>.

@trgiangdo
Copy link
Member

There is a problem with the pip install . since it does not follow the setup.py logic. You can read more about it here: https://stackoverflow.com/questions/21781734/entry-points-does-not-create-custom-scripts-with-pip-only-with-easy-install-in.

To sum up, what you can do is going to a different working directory and installing Taipy with an absolute path to the taipy directory. For example:

pip install $HOME/src/taipy

Please let me know if it can work.

@anunayasri
Copy link

Hi @trgiangdo . Sorry, I was not able to respond your comment earlier. I tried switching to a different directory but it didn't work. I tried using pip install --upgrade . and that also didn't work. :/

@trgiangdo
Copy link
Member

Again, installing with the "." will not work.

Please try to create a separate environment in a different directory than taipy, then install using the taipy path.

@anunayasri
Copy link

@trgiangdo Installing in a different directory also didn't work. I have already tried it. I have solved it temporarily by reverse engineering the taipy executable. Mentioning the steps below if someone else is facing the same problem.

cd $PROJECT_ROOT
touch extaipy.py  # executable taipy
# Paste the python script given below in the file 
# Update the python executable based on your venv

chmod +x extaipy.py

./extaipy.py help
#!/Users/anunayasri/workspace/taipy/.venv/bin/python    <<<<< Update based on your venv
import re
import sys
from taipy._entrypoint import _entrypoint

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(_entrypoint())

@jrobinAV jrobinAV removed the Core Related to Taipy Core label Apr 19, 2024
@anunayasri
Copy link

Hi. I wasn't able to be give time to wrap up this issue. I have picked it up to raise the PR. Getting the following error. I would appreciate if someone could help.

I have added git init logic to post-gen hook in both the tempaltes: taipy/templates/default/hooks/post_gen_project.py and taipy/templates/scenario-management/hooks/post_gen_project.py but mypy thinks these are duplicate packages. I have just added logic to existing packages!

taipy/templates/scenario-management/hooks/post_gen_project.py: error: Duplicate module named "post_gen_project" (also at "taipy/templates/default/hooks/post_gen_project.py")
taipy/templates/scenario-management/hooks/post_gen_project.py: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules for more info
taipy/templates/scenario-management/hooks/post_gen_project.py: note: Common resolutions include: a) using `--exclude` to avoid checking one of them, b) adding `__init__.py` somewhere, c) using `--explicit-package-bases` or adjusting MYPYPATH

@trgiangdo
Copy link
Member

In the pyproject.toml, we defined mypy to exclude (taipy/templates/|generate_pyi.py|tools)", which also excludes the duplicated modules in taipy/templates.

I'm not sure why you are getting the error tbh, but it should be fine when you commit and push the branch.

@trgiangdo
Copy link
Member

@anunayasri I assigned the issue to you because you are already working on it. Let me know if it's ok.

Thank you

@anunayasri
Copy link

@trgiangdo. Thanks for the help. I am totally fine to be the assignee. 👍🏼 Will raise the PR in some time.

@anunayasri anunayasri linked a pull request Apr 30, 2024 that will close this issue
@anunayasri
Copy link

Hi @trgiangdo . I have raised the PR. Could you have a look.
#1247

Copy link
Contributor

This issue has been labelled as "🥶Waiting for contributor" because it has been inactive for more than 14 days. If you would like to continue working on this issue, please add another comment or create a PR that links to this issue. If a PR has already been created which refers to this issue, then you should explicitly mention this issue in the relevant PR. Otherwise, you will be unassigned in 14 days. For more information please refer to the contributing guidelines.

@github-actions github-actions bot added the 🥶Waiting for contributor Issues or PRs waiting for a long time label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue New-contributor friendly 📈 Improvement Improvement of a feature. 🟩 Priority: Low Low priority and doesn't need to be rushed 🥶Waiting for contributor Issues or PRs waiting for a long time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants