Skip to main content

extract a monorepo subdir

Project description

PyPI version Python versions Build Black Coverage

This module (and related script) extracts the content of a subtree in a monorepo and it creates a stand alone repo (copying the related history).

Let say you have a monorepo with multiple projects (project1, project2 etc.) and we wan to make project1 a stand alone repo (retaining the project1 history):

monorepo/
├── README.TXT
├── misc
│   └── more
└── subfolder
    ├── project1           # <-- we want to extract this
    │   └── a
    │       ├── hello.txt
    │       └── subtree
    ├── project2
    └── project3

The command to to this is:

mono2repo init -v project1 monorepo/subfolder/project1

Installation

You can install mono2repo via pip from PyPI:

$ pip install mono2repo

The mono2repo.py is a standalone script and it can be just dowloaded:

curl -LO https://raw.githubusercontent.com/cav71/mono2repo/master/mono2repo.py

Example

For this example we first create the summary repo from the main pelican monorepo, then we update the summary with the new upstream changes:

https://github.com/getpelican/pelican-plugins.git
....
└ summary/
 ├── Readme.rst
 └── summary.py

Create a new repo

First we create a new repo:

mono2repo init summary-extracted \
    https://github.com/getpelican/pelican-plugins.git/summary

Update the repo

Update the summary-extracted with the latest summary related changes:

mono2repo update summary-extracted

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mono2repo-0.0.9.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

mono2repo-0.0.9-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file mono2repo-0.0.9.tar.gz.

File metadata

  • Download URL: mono2repo-0.0.9.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for mono2repo-0.0.9.tar.gz
Algorithm Hash digest
SHA256 c57f08f2831fd46db8d00f2061814dc5de80d4231ee0432999bf384d7dd31a88
MD5 05f0fb936563d23e8e23db5b419460bc
BLAKE2b-256 2b4ca5a7c2241ab339a963b3b02e865455ecca6c073dad375e90f9f360a6ec8b

See more details on using hashes here.

File details

Details for the file mono2repo-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: mono2repo-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for mono2repo-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 b35552e2c910d506f6c1ca82f20db9beeb4cee59fcc242e9bd3d90d744a2180d
MD5 6d1110477cd26e75c37cab0844848ca1
BLAKE2b-256 c21cda3832964aa7cad197f007fc75270c3113a40a2042c8c144220338b0df40

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page