Package: pyprojectx
Pyprojectx: All-inclusive Python ProjectsExecute scripts from pyproject.toml, installing tools on-the-flyFull documentationIntroductionPyprojectx makes it easy to create all-inclusive Python projects; no need to install any tools upfront,
not even Pyprojectx itself!Tools that are specified within your pyproject.toml file will be installed on demand when invoked from Pyprojectx:>./pwblacksrc
Collectingblack...
Successfullyinstalledblack-23.9.1...

Alldone!✨🍰✨18filesleftunchanged.Feature highlightsReproducible builds by treating tools and utilities as (versioned) dev-dependenciesNo global installs, everything is stored inside your project directory (like npm'snode_modules)Bootstrap your entire build process with a small wrapper script (like Gradle'sgradlewwrapper)Configure shortcuts for routine tasksSimple configuration inpyproject.tomlProjects can be build/tested/used immediately without explicit installation nor initialization:gitclonehttps://github.com/pyprojectx/px-demo.gitcdpx-demo
./pwbuildInstallationOne of the key features is that there is no need to install anything explicitly (except a Python 3.8+ interpreter).cdinto your project directory and download thewrapper scripts:Linux/Maccurl-LOhttps://github.com/pyprojectx/pyprojectx/releases/latest/download/wrappers.zip&&unzipwrappers.zip&&rm-fwrappers.zipWindowsInvoke-WebRequesthttps://github.com/pyprojectx/pyprojectx/releases/latest/download/wrappers.zip-OutFilewrappers.zip;Expand-Archive-Pathwrappers.zip-DestinationPath.;Remove-Item-Pathwrappers.zipGetting startedInitialize a new or existing project by adding tools (on Windows, replace./pwwithpw):./pw--addpdm,ruff,pre-commit,px-utilsFor reproducible builds and developer experience, it is recommended to lock the versions of the tools
and add the generatedpw.lockfile to your repository:./pw--lockCreate command shortcutsThetool.pyprojectx.aliasessection inpyproject.tomlcan contain commandline aliases:[tool.pyprojectx.aliases]# convenience shortcutsrun="poetry run"test="poetry run pytest"lint=["ruff check"]check=["@lint","@test"]UsageInstead of calling the CLI of a tool directly, prefix it with./pw(pwon Windows).Examples:./pwpoetryadd-Dpytestcdsrc
../pwlintAliases can be invoked as is or with extra arguments:./pwpoetryrunmy-script--foobar# same as above, but using the run alias./pwrunmy-script--foobarWhy yet another tool?As Python noob I had hard times setting up a project and building existing projectsThere is always someone in the team having issues with his setup, either with a specific tool, with Homebrew, pipx, ...Using (PDM or Poetry) dev-dependencies to install tools, impacts your production dependencies and can even lead to dependency conflictsDifferent projects often require different versions of the same toolExample projectsThis project (using PDM)px-demo(using PDM)DevelopmentBuild/test:gitclonehttps://github.com/pyprojectx/pyprojectx.gitcdpyprojectx
./pwbuildUse your local pyprojectx copy in another project: set the path to pyprojectx in thePYPROJECTX_PACKAGEenvironment variable
and create a symlink to the wrapper script.# Linux, MacexportPYPROJECTX_PACKAGE=path/to/pyprojectx
ln-s$PYPROJECTX_PACKAGE/src/pyprojectx/wrapper/pw.pypw# windowssetPYPROJECTX_PACKAGE=path/to/pyprojectx
mklink%PYPROJECTX_PACKAGE%\src\pyprojectx\wrapper\pw.pypw