GithubHelp home page GithubHelp logo

zet-cli's People

Contributors

dependabot[bot] avatar mattdood avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

minkiu

zet-cli's Issues

Example JSON is not installed by `setup.py`

Hey there,

thanks for this package, I would like to start using it but hit a little snag, I installed it via pip:
pip install zet-cli but when trying to run zet --help for the first time, it fails to find the .example.json:

  File "/home/minkiu/Projects/zet-cli/.venv/lib64/python3.10/site-packages/zet/settings.py", line 62, in __init__
    shutil.copyfile(example_settings, self.zet_local_env_path)
  File "/usr/lib64/python3.10/shutil.py", line 254, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/home/minkiu/Projects/zet-cli/.venv/lib64/python3.10/.env/.example.json'

Subsecuently it will fail with not finding the FileNotFoundError: [Errno 2] No such file or directory: '/home/minkiu/zet/.env/.local.json' since it did not create it in the first instance.

I think this is due to the setup.py not including in any way the .env directory upon installation, I tried some stuff but can't seem to make it work (not that familiar with setuptools, sorry).

This issue is in part to ask if it would make more sense to have the contents of .example.json inside settings.py and json.dump() that dict into the .local.json upon initialization. I can make a PR for this if you'd like it so.

And while typing this I wondered why make a hidden .json when the directory is already hidden? maybe it could be .env/local.json, but I digress.

Cheers!

EDIT:
Hmmm I believe the same might be happening with the default templates:

zet create -t "first entry" -c "tests" -tag "musings"
{'category': 'tests',
 'command': 'create',
 'tags': 'musings',
 'template': 'default',
 'title': 'first entry',
 'which': 'create',
 'zet_repo': 'zets'}
Traceback (most recent call last):
  File "/home/minkiu/.local/bin/zet", line 8, in <module>
    sys.exit(main())
  File "/home/minkiu/.local/lib/python3.10/site-packages/zet/main.py", line 366, in main
    zet.create(**filtered_args)
  File "/home/minkiu/.local/lib/python3.10/site-packages/zet/zet.py", line 166, in create
    new_file = shutil.copyfile(template, filename)
  File "/usr/lib64/python3.10/shutil.py", line 254, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/home/minkiu/.local/lib/python3.10/src/zet/templates/readme.md'

Although the path seems wrong: '/home/minkiu/.local/lib/python3.10/src/zet/templates/readme.md' it should pobably be '/home/minkiu/.local/lib/python3.10/site-packages/zet/templates/readme.md', right?

Here's the contents of the pip install zet-cli folder:

$ ls -lha ~/.local/lib/python3.10/site-packages/zet/
total 48K
drwxr-xr-x. 1 minkiu minkiu  172 Jan  5 18:49 .
drwxr-xr-x. 1 minkiu minkiu  166 Jan  5 18:49 ..
-rw-r--r--. 1 minkiu minkiu 1.3K Jan  5 18:49 editor_commands.py
-rw-r--r--. 1 minkiu minkiu 2.9K Jan  5 18:49 git_commands.py
-rw-r--r--. 1 minkiu minkiu    0 Jan  5 18:49 __init__.py
-rw-r--r--. 1 minkiu minkiu  12K Jan  5 18:49 main.py
drwxr-xr-x. 1 minkiu minkiu  332 Jan  5 18:49 __pycache__
-rw-r--r--. 1 minkiu minkiu 3.2K Jan  5 18:49 repo.py
-rw-r--r--. 1 minkiu minkiu 8.5K Jan  5 18:49 settings.py
-rw-r--r--. 1 minkiu minkiu 7.0K Jan  5 18:49 zet.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.