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
Platform Tree for Xiaomi Redmi Note 7/7S (lavender)

The Xiaomi Redmi Note 7 (codenamed "lavender") is a mid-range smartphone from Xiaomi announced in January 2019. Device specifications Device Xiaomi Re

MUHAMAD KHOIRON 2 Dec 20, 2021
A simple wrapper to analyse and visualise reinforcement learning agents' behaviour in the environment.

Visrl Visrl (pronounced "visceral") is a simple wrapper to analyse and visualise reinforcement learning agents' behaviour in the environment. Reinforc

Jet New 14 Jun 27, 2022
ICEtool - ICEtool plugin for QGIS

ICEtool ICEtool is an all in one QGIS plugin to easily compute ground temperatur

Arthur Evrard 13 Dec 16, 2022
Заглушки .NET библиотек для IronPython

Код репозитория основан на ironpython-stubs. Выражаю gtalarico бесконечную благодарность за вклад в развитие сообщества разработчиков скриптов и плаги

12 Nov 23, 2022
A python script to search for k-uniform Euclidean tilings.

k-uniform-solver A python script to search for k-uniform Euclidean tilings. This project's aim is to replicate and extend the list of k-uniform Euclid

3 Dec 06, 2022
MeepoBenchmark - This project aims at providing the scripts, logs, and analytic results for Meepo Blockchain

MeepoBenchmark - This project aims at providing the scripts, logs, and analytic results for Meepo Blockchain

Peilin Zheng 3 Aug 16, 2022
A Python wrapper for Matrix Synapse admin API

Synapse-admin-api-python A Python wrapper for Matrix Synapse admin API. Versioning This library now supports up to Synapse 1.45.0, any Admin API intro

Knugi 9 Sep 28, 2022
Linux GUI app to codon optimize many single-fasta files with coding sequences , using many taxonomy ids

codon_optimize_cds_with_many_taxids_singlefasta Linux GUI app to codon optimize many single-fasta files with coding sequences, using many taxonomy ids

Olga Tsiouri 1 Jan 23, 2022
Pyjiting is a experimental Python-JIT compiler, which is the product of my undergraduate thesis

Pyjiting is a experimental Python-JIT compiler, which is the product of my undergraduate thesis. The goal is to implement a light-weight miniature general-purpose Python JIT compiler.

Lance.Moe 10 Apr 17, 2022
Automatically find solutions when your Python code encounters an issue.

What The Python?! Helping you find answers to the errors Python spits out. Installation You can find the source code on GitHub at: https://github.com/

What The Python?! 139 Dec 14, 2022
A tool for checking if the external data used in Flatpak manifests is still up to date

Flatpak External Data Checker This is a tool for checking for outdated or broken links of external data in Flatpak manifests. Motivation Flatpak apps

Flathub 76 Dec 24, 2022
Learn to code in any language. If

Learn to Code It is an intiiative undertaken by Student Ambassadors Club, Jamshoro for students who are absolute begineers in programming and want to

Student Ambassadors' Club at Mehran UET 15 Oct 19, 2022
Daily knowledge pills to get better in Python.

Python daily pills Daily knowledge pills to get better Python code. Why Does your Python code suffers of any of this symptoms? Incorrect Indentation I

Jeferson Vaz dos Santos 35 Sep 19, 2022
Sodium is a general purpose programming language which is instruction-oriented

Sodium is a general purpose programming language which is instruction-oriented (a new programming concept that we are developing and devising)

Satin Wuker 22 Jan 11, 2022
little proyect to organize myself, but maybe can help someone else

TaskXT 0.1 Little proyect to organize myself, but maybe can help someone else Idea The main idea is to ogranize you work and stuff to do, but with onl

Gabriel Carmona 4 Oct 03, 2021
Interpreting-compiling programming language.

HoneyASM The programming language written on Python, which can be as interpreted as compiled. HoneyASM is easy for use very optimized PL, which can so

TalismanChet 1 Dec 25, 2021
This repository containing cross-section cut and fill calculations using Python programming language.

cross-section This repository is containing cut and fill calculations for cross-section using Python programming language. This codes is made to calcu

3 Jun 15, 2022
NORETURN is an esoteric programming language, based around the idea of not going back

NORETURN NORETURN is an esoteric programming language, based around the idea of not going back Concept Program coded in noreturn runs over one array,

1 Dec 15, 2021
Google Fit Sensor Component

Google Fit Sensor Component

Ivan Vojtko 21 Dec 20, 2022
Small scripts to learn about GNOME internals

gnome-hacks This is a collection of APIs that allow programmatic manipulation of the GNOME shell. If you use GNOME (the default graphical shell in Ubu

Alex Nichol 5 Oct 22, 2021