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
A python program with an Objective-C GUI for building and booting OpenCore on both legacy and modern Macs

A python program with an Objective-C GUI for building and booting OpenCore on both legacy and modern Macs, see our in-depth Guide for more information.

dortania 4.7k Jan 02, 2023
Edorado93 - Unraveling a Rockstar! -- Too much? Fine, Unraveling a humble programmer then?

Hi, I'm Sachin Malhotra ( ⛄ 💻 🎃 🍺 ) Let me set the records straight. Roger Federer is the GOAT and I will not hear otherwise! Now that we have that

Sachin Malhotra 7 Dec 25, 2022
This interactive script demonstrates the Menezes-Vanstone-EC-Cryptosystem

Menezes-Vanstone-EC-Cryptosystem This interactive script demonstrates the Meneze

Nishaant Goswamy 1 Jan 02, 2022
Module for remote in-memory Python package/module loading through HTTP/S

httpimport Python's missing feature! The feature has been suggested in Python Mailing List Remote, in-memory Python package/module importing through H

John Torakis 220 Dec 17, 2022
A script to generate NFT art living on the Solana blockchain.

NFT Generator This script generates NFT art based on its desired traits with their specific rarities. It has been used to generate the full collection

Rude Golems 24 Oct 08, 2022
Create standalone, installable R Shiny apps using Electron

Create standalone, installable R Shiny apps using Electron

Chase Clark 5 Dec 24, 2021
Simple Assembler with python

Assembler with python converts assembly source code to machine code Requirements Python 3 🐍 Usage python main.py [source] [output] [source] : Path t

Amir mohammad 1 Dec 24, 2021
A pure-Python codified rant aspiring to a world where numbers and types can work together.

Copyright and other protections apply. Please see the accompanying LICENSE file for rights and restrictions governing use of this software. All rights

Matt Bogosian 28 Sep 04, 2022
A dog facts python module

A dog facts python module

Fayas Noushad 3 Nov 28, 2021
Better GitHub statistics images for your profile, with stats from private and public repos

Better GitHub statistics images for your profile, with stats from private and public repos

Jacob Strieb 2k Dec 30, 2022
Module to align code with thoughts of users and designers. Also magically handles navigation and permissions.

This readme will introduce you to Carteblanche and walk you through an example app, please refer to carteblanche-django-starter for the full example p

Eric Neuman 42 May 28, 2021
PyDateWaiter helps waiting special day & calculating remain days till that day with Python code.

PyDateWaiter (v.Beta) PyDateWaiter helps waiting special day(aniversary) & calculating remain days till that day with Python code. Made by wallga gith

wallga 1 Jan 14, 2022
Iss-tracker - ISS tracking script in python using NASA's API

ISS Tracker Tracking International Space Station using NASA's API and plotting i

Partho 9 Nov 29, 2022
Check is a integer is even

Is Even Check if interger is even using isevenapi. https://isevenapi.xyz/ Main features: cache memoization api retry handler hide ads Install pip inst

Rosiney Gomes Pereira 45 Dec 19, 2022
Interactive class notebooks for ECE4076 Computer Vision, weeks 1 - 6

ECE4076 Interactive class notebooks for ECE4076 Computer Vision, weeks 1 - 6. ECE4076 is a computer vision unit at Monash University, covering both cl

Michael Burke 9 Jun 16, 2022
Flight Reservation App With Python

Flight Reservation App With Python

victor-h. 1 Nov 21, 2021
Toppr Os Auto Class Joiner

Toppr Os Auto Class Joiner Toppr os is a irritating platform to work with especially for students it takes a while and is problematic most of the time

1 Dec 18, 2021
IOP Support for Python (Experimental)

TAGS Experimental IOP Framework for Python WARNING: Currently, this project has NO EXCEPTION HANDLING. USE AT YOUR OWN RISK! I. Introduction to Interf

1 Oct 22, 2021
AlexaUsingPython - Alexa will pay attention to your order, as: Hello Alexa, play music, Hello Alexa

AlexaUsingPython - Alexa will pay attention to your order, as: Hello Alexa, play music, Hello Alexa, what's the time? Alexa will pay attention to your order, get it, and afterward do some activity as

Abubakar Sattar 10 Aug 18, 2022
A simple code for processing images to local binary pattern.

This figure is gotten from this link https://link.springer.com/chapter/10.1007/978-3-030-01449-0_24 LBP-Local-Binary-Pattern A simple code for process

Happy N. Monday 3 Feb 15, 2022