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
Just some mtk tool for exploitation, reading/writing flash and doing crazy stuff

Just some mtk tool for exploitation, reading/writing flash and doing crazy stuff. For linux, a patched kernel is needed (see Setup folder) (except for read/write flash). For windows, you need to inst

Bjoern Kerler 1.1k Dec 31, 2022
Placeholders is a single-unit storage solution for your Frontend.

Placeholder Placeholders is a single-unit file storage solution for your Frontend. Why Placeholder? Generally, when a website/service requests for fil

Tanmoy Sen Gupta 1 Nov 09, 2021
Sudoku solver using backtracking

Sudoku solver Sudoku solver using backtracking Basically in sudoku, we want to be able to solve a sudoku puzzle given an input like this, which repres

Kylie 99 Jan 07, 2023
Run python scripts and pass data between multiple python and node processes using this npm module

Run python scripts and pass data between multiple python and node processes using this npm module. process-communication has a event based architecture for interacting with python data and errors ins

Tyler Laceby 2 Aug 06, 2021
A tool to flash .ofp files in bootloader mode without needing MSM Tool, an alternative to official realme tool

Oppo/Realme Flash .OFP File on Bootloader A tool to flash .ofp files in bootloader mode without needing MSM Tool, an alternative to official realme to

Italo Almeida 70 Jan 02, 2023
This speeds up PyCharm's package index processes and avoids CPU & memory overloading

This speeds up PyCharm's package index processes and avoids CPU & memory overloading

1 Feb 09, 2022
Ramadhan countdown - Simple daily reminder about upcoming Ramadhan

Ramadhan Countdown Bot Simple bot for displaying daily reminder about Islamic pr

Abdurrahman Shofy Adianto 1 Feb 06, 2022
GUI for the Gammu library.

Wammu GUI for the Gammu library. Homepage https://wammu.eu/ License GNU GPL version 3 or later. First start On first start you will be asked for set

Gammu 60 Dec 14, 2022
Pacman - A suite of tools for manipulating debian packages

Overview Repository is a suite of tools for manipulating debian packages. At a h

Pardis Pashakhanloo 1 Feb 24, 2022
A beacon generator using Cobalt Strike and a variety of tools.

Beaconator is an aggressor script for Cobalt Strike used to generate either staged or stageless shellcode and packing the generated shellcode using your tool of choice.

Capt. Meelo 441 Dec 17, 2022
Practice in Oxford_AI&ML class

Practice in Oxford_AI&ML class

St3ve Lee 2 Feb 04, 2022
ToDo - A simple bot to keep track of things you need to do

ToDo A simple bot to keep track of things you need to do. Installation You will

3 Sep 18, 2022
A notebook explaining the principle of adversarial attacks and their defences

TL;DR: A notebook explaining the principle of adversarial attacks and their defences Abstract: Deep neural networks models have been wildly successful

1 Jan 22, 2022
This is a fork of the BakeTool with some improvements that I did to have better workflow.

blender-bake-tool This is a fork of the BakeTool with some improvements that I did to have better workflow. 99.99% of work was done by BakeTool team.

Acvarium 3 Oct 04, 2022
Data Science Course at Dept. of Computer Engineering, Chula 2022

2110446 Data Science Course at Chula 2022 Short links for exercises: Week1: Intro to Numpy, Pandas Numpy: https://colab.research.google.com/github/kao

Kao Panboonyuen 17 Nov 27, 2022
Data-driven Computer Science UoB

COMS20011_2021 Data-driven Computer Science UoB Staff Laurence Aitchison [ 6 May 16, 2022

Here is my Senior Design Project that I implemented to graduate from Computer Engineering.

Here is my Senior Design Project that I implemented to graduate from Computer Engineering. It is a chatbot made in RASA and helps the user to plan their vacation in the Turkish language. In order to

Ezgi Subaşı 25 May 31, 2022
Nicotine+: A graphical client for the SoulSeek peer-to-peer system

Nicotine+ Nicotine+ is a graphical client for the Soulseek peer-to-peer file sharing network. Nicotine+ aims to be a pleasant, Free and Open Source (F

940 Jan 03, 2023
Python: Wrangled and unpivoted gaming datasets. Tableau: created dashboards - Market Beacon and Player’s Shopping Guide.

Created two information products for GameStop. Using Python, wrangled and unpivoted datasets, and created Tableau dashboards.

Zinaida Dvoskina 2 Jan 29, 2022
Mengzhan (John) code for Closed Loop Control system of Sharp Wave Ripples in Hippocampus CA3 region

ClosedLoopControl_Yu Mengzhan (John) code for Closed Loop Control system of Sharp Wave Ripples in Hippocampus CA3 region Creating Python Virtual Envir

Mengzhan (John) Liufu 1 Jan 22, 2022