Open bhajneet opened 3 days ago
Another idea, off the top of my head, would be to allow for multiple templates (or project default templates) when creating new hatch. Like this https://hatch.pypa.io/latest/config/project-templates/ is not actually what I'm asking for in this issue, since I do still create projects that need tests, or projects that need tests and will be published/distributed later, etc.
But it could be nice to have something like:
hatch new
hatch new --template "bare"
hatch new --template "package"
Have you seen this? https://hatch.pypa.io/latest/how-to/run/python-scripts/
That is quite nice too, thank you! I can start using that today for the simple scripts
I still think it would be worth having multiple templates to choose between for new projects, so going to leave this issue open and rename the title
Also for some reason getting these errors:
hatch run main.py
/bin/sh: main.py: command not found
hatch run ./main.py
/bin/sh: ./main.py: Permission denied
the script simply does this:
print("hello, world!")
show the full script
Hello, I do a lot of one-off python projects, what I'm looking for in these situations is a very easy way to create a virtual environment and dependency management, often for a single main.py file. It would be nice to use hatch for these situations even if I'm not planning to build or package the project. Correct me if wrong, but it would be nice to run something like:
hatch new --bare
and get something simple like
pyproject.toml
andmain.py
created inside itpyproject.toml could contain just the bare necessity:
This would make it much easier to use hatch for new (super-simple) projects. It would also be nice to somehow remove the requirement for name / version (again this is more important when sharing a project, but not necessarily for locally managed ones)