This is a Poetry plugin that will make it possible to build projects using custom TOML files

Overview

Poetry Multiproject Plugin

This is a Poetry plugin that will make it possible to build projects using custom TOML files.

This is especially useful when structuring code in a Monorepo, containing several projects.

When installed, there will be a new command available: build-project.

How is it different from the "poetry build" command?

As I understand it, Poetry doesn't allow to reference code that is outside of the project root.

Something like:

packages = [{ include = "../../../my-package" }]

As an alternative to have a pyproject.toml file in a subfolder, this plugin supports a Monorepo file structure like this:

my-app/
   app.py

my-service/
   app.py

my-package/
   __init__.py
   my_package.py

my-other-package/
   __init__.py
   my_other_package.py

pyproject.toml
my-app.toml
my-service.toml
...

The different TOML files can include different local dependencies. Let's say that my-app imports my-package, and my-service imports my-package only.

my-app and my-service can be built separately and include the local packages needed. By being placed at the workspace root, will not cause any issues with relative paths.

Usage

This plugin depends on a preview of Poetry with functionality for adding custom Plugins. Have a look at the official Poetry preview docs for how to install it.

Install the plugin according to the official Poetry docs.

When installed, there will be a new command available: build-project.

This command will build your project, just like the poetry build command, but with a custom project TOML file.

poetry build-project --t myproject.toml

(use --t or --toml to specify your custom TOML file to use)

Comments
  • another similar plugin

    another similar plugin

    Hello,

    I saw your poetry-core PR to add workspaces. Thanks and I hope it works out!

    As I was looking through available solutions I also found this plugin. I haven't had enought time yet to look in much detail but I thought you might be interested in seeing/comparing.

    Anyway, thanks and have a good day!

    opened by bhelgs 4
  • Support python version 3.8

    Support python version 3.8

    Description

    Add support for python version 3.8

    Motivation and Context

    How Has This Been Tested?

    Built and imported in another Poetry project

    Types of changes

    • [ ] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

    Checklist:

    opened by Brejkarn 1
  • Broken dist build paths when collecting shared packages in workspace

    Broken dist build paths when collecting shared packages in workspace

    I think that this need some more work. When building, the dist will contain code that are in separate folders and that will probably not work when installing the build code as a dependency (entry point, imports that are one level only).

    A possible solution: The BuildIncludeFile.relative_to_source_root could return a custom path for the workspace scenario Pull request #6

    opened by DavidVujic 1
  • fix(check-project): from top folder

    fix(check-project): from top folder

    Description

    Fix: mypy analyser running properly when check-project from top folder with the --directory option.

    Motivation and Context

    Fixes #22

    How Has This Been Tested?

    CI ✅

    Types of changes

    • [x] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

    Checklist:

    opened by DavidVujic 0
  • check-project: does not analyze code correctly

    check-project: does not analyze code correctly

    Describe the bug A clear and concise description of what the bug is.

    The check-project command does not work as intended when using it from a top folder and with the --directory option.

    bug 
    opened by DavidVujic 0
  • fix: add support for global options

    fix: add support for global options

    Description

    Adding support for the --directory option in build-project and check-project

    Adding support for the --verbose option in check-project, because this command mutes output by default

    Motivation and Context

    Fixes #20

    How Has This Been Tested?

    CI ✅

    Types of changes

    • [x] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

    Checklist:

    opened by DavidVujic 0
  • missing support for the new

    missing support for the new "--directory" option

    Describe the bug A clear and concise description of what the bug is. Since Poetry 1.3.x there is a possibility to add the --directory option. This is very useful for monorepos and makes folder navigation unnecessary. But that option does not currently work as expected for any of the commands in this plugin.

    To Reproduce Steps to reproduce the behavior:

    1. Open a terminal window
    2. Go to root of the project
    3. Run the command check-project or build-project with the directory option
    4. The actual project isn't checked or built.

    Expected behavior The check-project and build-project commands should to the actions on the directory pointed at with the new --directory option.

    bug 
    opened by DavidVujic 0
  • fix: check-project command with reusable venv

    fix: check-project command with reusable venv

    Description

    Use the Poetry global cache-dir for the temporary virtual environment that is created during check-project. This will speed up the process, and avoid unnecessary network calls.

    Motivation and Context

    Making the check-project command faster, because it can reuse a virtual environment already created.

    How Has This Been Tested?

    CI ✅ Locally installed the plugin and tested in code repos.

    Types of changes

    • [x] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

    Checklist:

    opened by DavidVujic 0
  • fix: check-project command

    fix: check-project command

    Fixes a non-functioning check-project command.

    Description

    The command will install dependencies by using poetry install in a temp folder, then run poetry run mypy with a path to the project-specific top namespace.

    Motivation and Context

    How Has This Been Tested?

    Types of changes

    • [x] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

    Checklist:

    opened by DavidVujic 0
  • Check project

    Check project

    New command: check-project

    Description

    This command is mainly useful to check for any missing dependencies or packages in code for a project.

    It uses MyPy under the hood.

    Motivation and Context

    To be able to check for any missing dependencies or similar in a monorepo, containing several projects.

    How Has This Been Tested?

    CI build ✅

    Types of changes

    • [ ] Bug fix (non-breaking change which fixes an issue)
    • [x] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

    Checklist:

    opened by DavidVujic 0
  • dev: add mypy checks to ensure Python 3.8 compatibility

    dev: add mypy checks to ensure Python 3.8 compatibility

    Description

    Add mypy checks in CI, to ensure Python 3.8 compatibility.

    Also: Workaround for tomlkit typing issues by using the 'typing.cast' function.

    Motivation and Context

    To avoid using modern Python syntax, without checking it is available in Python 3.8.

    How Has This Been Tested?

    CircleCI ✅

    Types of changes

    • [x] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

    Checklist:

    opened by DavidVujic 0
Releases(v1.1.4)
  • v1.1.4(Dec 29, 2022)

    Fix: mypy analyser running properly when check-project from top folder with the --directory option.

    Pull Request https://github.com/DavidVujic/poetry-multiproject-plugin/pull/23

    Source code(tar.gz)
    Source code(zip)
  • v1.1.3(Dec 29, 2022)

    Adding support for the --directory option in build-project and check-project Adding support for the --verbose option in check-project, because this command mutes output by default

    Pull Request https://github.com/DavidVujic/poetry-multiproject-plugin/pull/21

    Source code(tar.gz)
    Source code(zip)
  • v1.1.2(Dec 28, 2022)

    Use the Poetry global cache-dir for the temporary virtual environment that is created during check-project. This will speed up the process, and avoid unnecessary network calls.

    Pull Request https://github.com/DavidVujic/poetry-multiproject-plugin/pull/19

    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Dec 27, 2022)

    Fixes the check-project command that didn't work as intended.

    More info in Pull request https://github.com/DavidVujic/poetry-multiproject-plugin/pull/18

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Dec 26, 2022)

    This command is mainly useful to check for any missing dependencies or packages in code for a project. It uses MyPy under the hood.

    Pull Request: https://github.com/DavidVujic/poetry-multiproject-plugin/pull/17

    Source code(tar.gz)
    Source code(zip)
  • v1.0.5(Nov 10, 2022)

  • v1.0.2(Oct 30, 2022)

    Updates:

    • Run the poetry-build command in the actual project foder.
    • make sure the package includes section has no duplicates in the generated pyproject.toml file
    Source code(tar.gz)
    Source code(zip)
  • v0.3.2(Feb 5, 2022)

    fixing the broken 'package includes' packaging.

    NOTE: now require that shared packages are structured within a root namespace, as described in the README.md.

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Jan 30, 2022)

    A dist folder will be added in the actual project when running poetry build-project -t path/to/pyproject.toml.

    Also, changes in how relative package includes are set in the pyproject.toml.

    packages = [
        { include = "the_code_in_my_project"
        { include = "../../../my-shared-package" }]
    
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Jan 28, 2022)

    This is a breaking feature: removing the possibility to set a custom name for a TOML file. I don't think this is needed anymore, since it is possible to set the workspace directory and build a project specific pyproject.toml with package includes that are "above" the actual project directory.

    Decided to not use Semver for this yet, because the project still is in experimental mode.

    Also: this version has less of manipulating with the Poetry internals (no factory overloads, use the original build command handle function).

    Source code(tar.gz)
    Source code(zip)
  • 0.1.2(Jan 23, 2022)

  • 0.1.0(Jan 23, 2022)

    This is the very first release, and the plugin is available at PyPi.

    Please note that this plugin is dependent on a preview of the Poetry tool.

    Source code(tar.gz)
    Source code(zip)
Owner
David Vujic
David Vujic
Poetry plugin to bundle projects into various formats

Poetry bundle plugin This package is a plugin that allows the bundling of Poetry projects into various formats. Installation The easiest way to instal

Poetry 54 Jan 2, 2023
poetry2nix turns Poetry projects into Nix derivations without the need to actually write Nix expressions

poetry2nix poetry2nix turns Poetry projects into Nix derivations without the need to actually write Nix expressions. It does so by parsing pyproject.t

Nix community projects 405 Dec 29, 2022
Poetry workspace plugin for Python monorepos.

poetry-workspace-plugin Poetry workspace plugin for Python monorepos. Inspired by Yarn Workspaces. Adds a new subcommand group, poetry workspace, whic

Jack Smith 74 Jan 1, 2023
🛠️ Plugin to integrate Chuy with Poetry

Archived This is bundled with Chuy since v1.3.0. Poetry Chuy Plugin This plugin integrates Chuy with Poetry. Note: This only works in Poetry 1.2.0 or

Eliaz Bobadilla 4 Sep 24, 2021
A command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, VueJS projects.

Cookiecutter A command-line utility that creates projects from cookiecutters (project templates), e.g. creating a Python package project from a Python

null 18.6k Jan 2, 2023
Demo Python project using Conda and Poetry

Conda Poetry This is a demonstration of how Conda and Poetry can be used in a Python project for dev dependency management and production deployment.

Ryan Allen 2 Apr 26, 2022
Bazel rules to install Python dependencies with Poetry

rules_python_poetry Bazel rules to install Python dependencies from a Poetry project. Works with native Python rules for Bazel. Getting started Add th

Martin Liu 7 Dec 15, 2021
Canim1 - Simple python tool to search for packages without m1 wheels in poetry lockfiles

canim1 Usage Clone the repo. Run poetry install. Then you can use the tool: ❯ po

Korijn van Golen 1 Jan 25, 2022
Custom Weapons 3 attribute support for Custom Weapons X

CW3toX Allows use of Custom Weapons 3 attributes in Custom Weapons X. Requiremen

null 2 Mar 1, 2022
Beginner Projects A couple of beginner projects here

Beginner Projects A couple of beginner projects here, listed from easiest to hardest :) selector.py: simply a random selector to tell me who to faceti

Kylie 272 Jan 7, 2023
My custom Fedora ostree build with sway/wayland.

Ramblurr's Sway Desktop This is an rpm-ostree based minimal Fedora developer desktop with the sway window manager and podman/toolbox for doing develop

Casey Link 1 Nov 28, 2021
Custom SLURM wrapper scripts to make finding job histories and system resource usage more easily accessible

SLURM Wrappers Executables job-history A simple wrapper for grabbing data for completed and running jobs. nodes-busy Developed for the HPC systems at

Sara 2 Dec 13, 2021
A community-driven python bot that aims to be as simple as possible to serve humans with their everyday tasks

JARVIS on Messenger Just A Rather Very Intelligent System, now on Messenger! Messenger is now used by 1.2 billion people every month. With the launch

Swapnil Agarwal 1.3k Jan 7, 2023
YunoHost is an operating system aiming to simplify as much as possible the administration of a server.

YunoHost is an operating system aiming to simplify as much as possible the administration of a server. This repository corresponds to the core code, written mostly in Python and Bash.

YunoHost 1.5k Jan 9, 2023
frida-based ceserver. iOS analysis is possible with Cheat Engine.

frida-ceserver frida-based ceserver. iOS analysis is possible with Cheat Engine. Original by Dark Byte. Usage Install frida on iOS. python main.py Cyd

KenjiroIchise 89 Jan 8, 2023
This is a modified variation of abhiTronix's vidgear. In this variation, it is possible to write the output file anywhere regardless the permissions.

Info In order to download this package: Windows 10: Press Windows+S, Type PowerShell (cmd in older versions) and hit enter, Type pip install vidgear_n

Ege Akman 3 Jan 30, 2022
A Powerful Tool For Making Combo List(All possible modes)

ComboMaker A Powerful Tool For Making Combo List Introduction Check out all possible Combo list build modes with this tool =) How to Install Open the

MasterBurnt 7 Jan 7, 2023
Werkzeug has a debug console that requires a pin. It's possible to bypass this with an LFI vulnerability or use it as a local privilege escalation vector.

Werkzeug Debug Console Pin Bypass Werkzeug has a debug console that requires a pin by default. It's possible to bypass this with an LFI vulnerability

Wyatt Dahlenburg 23 Dec 17, 2022
An interactive tool with which to explore the possible imaging performance of candidate ngEHT architectures.

ngEHTexplorer An interactive tool with which to explore the possible imaging performance of candidate ngEHT architectures. Welcome! ngEHTexplorer is a

Avery Broderick 7 Jan 28, 2022