Tools for dealing with the vendored libraries and requirement lists in pymedusa/Medusa.
- They are very much a work in progress, and could fail at any time.
- They are made to be used on Medusa's
develop
branch and feature branches targetingdevelop
. - Their documentation isn't great.
- They are far from perfect, and you should always verify the changes before committing / pushing them.
- They are targeted towards Windows, but Unix/POSIX should work too.
- (Windows) Python Launcher (
py
) installed and in PATH - Python 3.7 or later, with the following packages installed:
pip
setuptools
requests
- Latest Python 2.7 in PATH, with the following packages installed:
pip
setuptools
mock
Recommended: Clone this repository and install in "editable" mode:
git clone https://github.com/sharkykh/medusa_vendor_tools
cd medusa_vendor_tools
pip install -e .
Then update using git pull
in the repository directory.
Or: Install from archive:
pip install https://github.com/sharkykh/medusa_vendor_tools/archive/master.tar.gz
(can also use .zip
archive)
cd C:\path\to\Medusa
mvt -h
mvt <command> [-h | <arguments>]
Vendor (or update existing) libraries.
usage: mvt vendor [-h] [-2] [-3] [-6] [-u [package [package ...]]] [--pre]
[-f LISTFILE]
package
positional arguments:
package Package to vendor
optional arguments:
-h, --help show this help message and exit
-2, --py2 Force install Python 2 version to [target]2
-3, --py3 Force install Python 3 version to [target]3
-6, --py6 Force install Python 3 version to [target]
-u [package [package ...]], --usage [package [package ...]]
Packages that use this library (to add to the used by
column)
--pre Include pre-release and development versions. By
default, pip only finds stable versions.
-f LISTFILE, --listfile LISTFILE
List file to update (affects target folders). Defaults
to `ext/readme.md`
Update already-vendored library by name.
usage: mvt update [-h] [-c] [--pre] [-f LISTFILE] package
positional arguments:
package Package name to update
optional arguments:
-h, --help show this help message and exit
-c, --cmd Generate a `vendor` command for the provided package
(does not update)
--pre Include pre-release and development versions. By
default, pip only finds stable versions.
-f LISTFILE, --listfile LISTFILE
List file to update (affects target folders). Defaults
to `ext/readme.md`
Generate requirements.txt
(or JSON) from ext/readme.md
.
usage: mvt gen [-h] [-i INFILE] [-o OUTFILE] [-a] [-j]
optional arguments:
-h, --help show this help message and exit
-i INFILE, --infile INFILE
Input file. Defaults to `ext/readme.md`
-o OUTFILE, --outfile OUTFILE
Output file. Defaults to `requirements.txt` (with
`--json`: `requirements.json`)
-a, --all-packages List all packages, not just those used by Medusa
-j, --json export as JSON to `requirements.json` (or OUTFILE)
List outdated packages.
usage: mvt outdated [-h] [-f LISTFILE] [package [package ...]]
positional arguments:
package Package(s) to check. If not provided, checks all of
the packages.
optional arguments:
-h, --help show this help message and exit
-f LISTFILE, --listfile LISTFILE
List file to check. Defaults to `ext/readme.md`
Remove vendored library by name.
usage: mvt remove [-h] [-f LISTFILE] package
positional arguments:
package Package name to remove
optional arguments:
-h, --help show this help message and exit
-f LISTFILE, --listfile LISTFILE
List file to update (affects target folders). Defaults
to `ext/readme.md`
Test parsing ext/readme.md
or lib/readme.md
.
usage: mvt parse [-h] file
positional arguments:
file The list file to test.
optional arguments:
-h, --help show this help message and exit
Check vendor folders using ext/readme.md
or lib/readme.md
.
usage: mvt check [-h] file
positional arguments:
file The list file to test.
optional arguments:
-h, --help show this help message and exit
Sort ext/readme.md
and lib/readme.md
by package name.
usage: mvt sort [-h]
optional arguments:
-h, --help show this help message and exit
Generate ext/readme.md
from requirements.json
or from itself.
usage: mvt make [-h] [-i INFILE] [-o OUTFILE]
optional arguments:
-h, --help show this help message and exit
-i INFILE, --infile INFILE
JSON or Markdown input file. Defaults to
`requirements.json`
-o OUTFILE, --outfile OUTFILE
Markdown output file. Defaults to `ext/readme.md`
ext
- Vendored libraries that are Python2/Python3 compatible.ext2
- Vendored libraries that are only for Python2.ext3
- Vendored libraries that are only for Python3.ext/readme.md
- A listing of the vendored libraries present in the folders above.lib
- Vendored libraries whose codes are customized to fit Medusa's needs, and other miscellaneous stuff.lib/readme.md
- A listing of everything present in the folder above.requirements.txt
- A listing of Medusa's direct dependencies (imported by themedusa
package).
Renovate uses this to provide version updates.