Package: setupinit
SetupinitProperly initialize a Python projectThis project is part of thePyrustic Open Ecosystem.Installation.Latest.DocumentationTable of contentsOverviewExampleAPIProject structureRelated projectsInstallationOverviewSetupinitis a command line tool that turns anemptydirectory into a Python project. This tool also ensures that anexistingPython project is properly initialized. When you runsetupinit initfrom the command line, the current working directory is populated with files and folders following the conventional Python project structure as described in thePython Packaging User Guide.Setupinitderives theproject namefrom the current working directory, then computes thepackage namefrom it. The package name is different from the project name. For example, the package name of thecyberpunk-themeproject iscyberpunk_theme. The package name is then used to initialize the contents of certain files likesetup.cfg.As a developer, you remain in control of your project, so no existing file will be modified bySetupinit. If, for example, you accidentally corrupted the contents ofsetup.cfg, you can simply delete it, then runsetupinit initfrom the command line to create a brand newsetup.cfg.ExampleInitializean empty Python project:$cd/path/to/project
$setupinitinit
Successfullyinitialized!Check if a project isinitialized:$cd/path/to/demo
$setupinitcheck
Thisprojectisalreadyinitialized!APISetupinitexposes an API (the same used by the CLI) with which you can interact programmatically in Python.importsetupinitPROJECT_DIR="/path/to/project"project_name=setupinit.get_project_name(PROJECT_DIR)ifsetupinit.initialized(PROJECT_DIR):msg="{}is already initialized.".format(project_name)print(msg)else:setupinit.initialize(PROJECT_DIR)msg="{}is initialized !".format(project_name)print(msg)Read themodules documentation.Project structureThis is the contents of a newly created Python project withSetupinit:demo/  # the demo project ($PROJECT_DIR) [1]
    demo/  # this is the app package ($APP_PKG) [2]
        __init__.py
        __main__.py  # the mighty entry point of your app !
    tests/
        __init__.py
    MANIFEST.in  # already filled with convenient lines of rules
    pyproject.toml  # the new unified Python project settings file [3]
    README.md
    setup.cfg  # define here your name, email, dependencies, and more [4]
    setup.py  # it is not a redundancy, don't remove it, don't edit it [5]
    VERSION  # unique location to define the version of the app [6]
    .gitignore  # you can edit it if you want[1]This is the project directory ($PROJECT_DIR).[2]Your codebase lives in the app package ($APP_PKG).[3]ReadWhat the heck is pyproject.toml ?and thePEP 518.[4]Read thisuser guideto edit thesetup.cfgfile.[5]If you want editable installs you still need asetup.pyshim.[6]You won't need to edit this file if you useBackstageorBuildvera command line tool with a built-in intuitive versioning mechanism.You can even run this new project:$cd/path/to/demo
$python-mdemo
HelloFriend!Related projectsFor a smooth developer experience, you can try related projects:buildverandbackstage.BuildverBuildveris a command line tool to build a Python distribution package from a project. This tool comes with abuilt-in versioning mechanismthat works smoothly with the package builder while being intuitive for the user.DiscoverBuildver!BackstageBackstageis alanguage-agnosticcommand line tool that allows the developer to define, coordinate, and use the various resources at his disposal to create and manage a software project.DiscoverBackstage!InstallationSetupinitiscross platformand versions under1.0.0will be consideredBetaat best. It is built onUbuntuwithPython 3.8and should work onPython 3.5ornewer.For the first time$pipinstallsetupinitUpgrade$pipinstallsetupinit--upgrade--upgrade-strategyeagerBack to top