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 flit new CLI #597

Open
Conchylicultor opened this issue Sep 23, 2022 · 4 comments
Open

Add flit new CLI #597

Conchylicultor opened this issue Sep 23, 2022 · 4 comments

Comments

@Conchylicultor
Copy link

Currently poetry has a poetry new my_package command which create a new folder containing the minimal required files to publish a project to PyPI.

This is very convenient because I can publish a new PyPI project directly from the CLI:

poetry new my_project
cd my_project
poetry build
poetry publish

However this is currently not possible with flit because the lack of new command. Like everything in flit, the default template could be something minimal, like:

my_project/
    my_project/
        __init__.py
    pyproject.toml
    README.md
@pradyunsg
Copy link
Member

FWIW, how would this be different from flit init?

@Conchylicultor
Copy link
Author

Conchylicultor commented Sep 23, 2022

flit init / poetry init only create the pyproject.toml on an existing my_project/ folder.
poetry new create a minimal my_project/ folder (with __init__.py, pyproject.toml, README.md)

@takluyver
Copy link
Member

takluyver commented Sep 27, 2022

I can see the attraction of the idea, but I think this kind of project setup & automation should be done in a separate tool, not as part of Flit itself.

cookiecutter is one such tool, and there's nothing to stop anyone making a 'Python project with Flit packaging' template for that. Maybe someone already has? Cookiecutter has never entirely clicked for me, though, because I like to start with an empty folder and add bits like packaging, tests, docs, CI when I'm ready for them. I'd be interested to see a tool based around adding pieces like that onto an existing project, like a more advanced cousin of flit init and sphinx-quickstart.

Of course, there's also value in keeping things simple and not forcing people to learn many different tools. That's why flit init exists. But at present, I'm inclined to leave it at that and not add more features for setting up and modifying a project.

@z3dev
Copy link

z3dev commented Feb 1, 2024

Tis true that initializing a project structure might be outside the scope of flit, however even the python.org manual on managing python packing only supplies a 'suggested' folder structure. And if you search around, there are hundreds of opinions.

So, for the new python user, a tool to setup a new project would be a huge benefit. Why not flit? It has a certain expectations on the structure.

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