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
Minecraft Multi-Server Pinger Discord Embed

Minecraft Network Pinger Minecraft Multi-Server Pinger Discord Embed What does this bot do? It sends an embed and uses mcsrvstat API and checks if the

YungHub 2 Jan 05, 2022
PyScaffold is a project generator for bootstrapping high quality Python packages

PyScaffold is a project generator for bootstrapping high quality Python packages, ready to be shared on PyPI and installable via pip. It is easy to use and encourages the adoption of the best tools a

PyScaffold 1.7k Jan 03, 2023
Path of Exile Vendor Recipe Tracker (Chaos/Regal orb)

Path of Exile Vendor Trade Tracker Are you tired of manually keeping track of collected and missing items for farming Chaos or Regal Orbs in PoE? Me t

1 Nov 09, 2021
Simple script to match riders with drivers.

theBestPooler Simple script to match riders with drivers. It's a greedy, unoptimised search, so no guarantees that it works. It just seems to work (ve

Devansh 1 Nov 22, 2021
Python implementation of the Lox language from Robert Nystrom's Crafting Interpreters

pylox Python implementation of the Lox language from Robert Nystrom's Crafting Interpreters. https://craftinginterpreters.com. This only implements th

David Beazley 37 Dec 28, 2022
A simple IDA Pro plugin to show all HexRays decompiler comments written by user

XRaysComments A simple IDA Pro plugin to show all HexRays decompiler comments written by user Installation Copy the file xray_comments.py to the plugi

Nox 20 Dec 27, 2022
GDIT: Geometry Dash Info Tool

GDIT: Geometry Dash Info Tool This is the first large script that allows you to quickly get information from the Geometry Dash server

dezz0xY 2 Jan 09, 2022
Design-by-contract in Python3 with informative violation messages and inheritance

icontract icontract provides design-by-contract to Python3 with informative violation messages and inheritance. It also gives a base for a flourishing

275 Jan 02, 2023
Tools for dos (denial-of-service) website / web server

DoS Attack Tools Tools for dos (denial-of-service) website / web server di buat olah NurvySec How to install on debian / ubuntu $ apt update $ apt ins

nurvy 1 Feb 10, 2022
K2HASH Python library - NoSQL Key Value Store(KVS) library

k2hash_python Overview k2hash_python is an official python driver for k2hash. Install Firstly you must install the k2hash shared library: curl -o- htt

Yahoo! JAPAN 3 Oct 19, 2022
Web app to find your chance of winning at Texas Hold 'Em

poker_mc Web app to find your chance of winning at Texas Hold 'Em A working version of this project is deployed at poker-mc.ue.r.appspot.com. It's run

Aadith Vittala 7 Sep 15, 2021
An extension module to make reaction based menus with disnake

disnake-ext-menus An experimental extension menu that makes working with reaction menus a bit easier. Installing python -m pip install -U disnake-ext-

1 Nov 25, 2021
Helps to arrange nodes

Relax brush for nodes, helps to arrange nodes easier.

336 Dec 15, 2022
Zotero references script (and app)

A little script (and PyInstaller build) for a very specific, somewhat hack-ish purpose: managing and exporting project references with Zotero and its API.

Marius Rödder 0 Dec 05, 2021
Automatic and platform-independent unpacker for Windows binaries based on emulation

_ _ __ _ __ _ | | | | / / (_) \ \ | | | | | |_ __ | | _ | | _ __ __ _ ___| | _____ _ __

514 Dec 21, 2022
Pampy: The Pattern Matching for Python you always dreamed of.

Pampy: Pattern Matching for Python Pampy is pretty small (150 lines), reasonably fast, and often makes your code more readable and hence easier to rea

Claudio Santini 3.5k Dec 30, 2022
Rofi script to minimize / unminimize multiple windows in qtile

Qminimize Rofi script to minimize / unminimize multiple windows in qtile Additional requirements : EWMH module fuzzywuzzy module How to use it : - Clo

9 Sep 18, 2022
A web-based analysis toolkit for the System Usability Scale providing calculation, plotting, interpretation and contextualization utility

System Usability Scale Analysis Toolkit The System Usability Scale (SUS) Analysis Toolkit is a web-based python application that provides a compilatio

Jonas Blattgerste 3 Oct 27, 2022
Create rangebased on lists or values of the range itself. Range any type. Can you imagine?

funcao-allrange-for-python3 Create rangebased on lists or values of the range itself. Range any type. Can you imagine? WARNING!!! THIS MODULE DID NOT

farioso-fernando 1 Feb 09, 2022
A Red Team tool for exfiltrating sensitive data from Jira tickets.

Jir-thief This Module will connect to Jira's API using an access token, export to a word .doc, and download the Jira issues that the target has access

Antonio Piazza 82 Dec 12, 2022