Skip to main content

Modern Python Package Installer

Project description

Moppi

Moppi - Modern Python Package Installer.
Automatically manages dependencies using pyproject.toml file.

Usage

moppi add flask fastapi
moppi add black --dev
moppi update flask
moppi remove flask
moppi apply
moppi apply --dev

Config file example, stored in pyproject.toml

[project]
dependencies = [
    "fastapi==0.88.0",
]

[project.optional-dependencies]
dev = [
    "black==22.12.0",
]

[tool.moppi]
indirect-dependencies = [
    "starlette==0.23.1 :: fastapi==0.88.0",
    "idna==3.4 :: anyio==3.6.2",
    "platformdirs==2.6.0 :: black==22.12.0",
    "click==8.1.3 :: black==22.12.0",
    "anyio==3.6.2 :: starlette==0.23.1",
    "pydantic==1.10.2 :: fastapi==0.88.0",
    "typing-extensions==4.4.0 :: pydantic==1.10.2",
    "mypy-extensions==0.4.3 :: black==22.12.0",
    "sniffio==1.3.0 :: anyio==3.6.2",
    "pathspec==0.10.2 :: black==22.12.0",
]

Installation

Moppi should be only used inside of a virtualenv.
The best way to boot Moopi is to create a virtualenv and install moppi package via pip.

python -m venv .env
source .env/bin/activate
pip install moppi

Docker usage example

FROM python:3.11-slim

# Creating a non-root user, so third party packages can't tamper with the hosts file,
system clock or run outside of a container using some vulnerabilty.
RUN useradd -D app
WORKDIR /home/app
USER app

# Create venv and install moppi
RUN python -m venv env
RUN source env/bin/activate
RUN pip install moppi

# Install production dependencies.
COPY --chown=app:app moppi.yaml .
RUN python -m moppi apply

# Copy local code to the container image.
COPY --chown=app:app . .

# Run the web service on container startup. Here we use the gunicorn
# webserver, with one worker process and 8 threads.
CMD ["gunicorn", "--bind", ":$PORT", "--threads", "8", "main:app"]

todo

tar.gz unpacking
sha256 check, but don't save it into moppi.yaml (make configurable?)
platform=Windows support
extra=='package' support
upload to arch aur and ubuntu?
Caching
Async
Replace print with logging error warning info
Check pip cli, but not the source
Can install other moppi projects without extra configuration.
sysconfig:
purelib = "/home/gen/moppi/.env/lib/python3.11/site-packages"
scripts = "/home/gen/moppi/.env/bin"
moppi[full] - includes tomli_w and pyyaml. Or moppi[lean]
--index-url https://test.pypi.org/simple/
--no-deps
Drop yaml support?
--dev -d / --test / --cicd / --doc / --tools / --all

done

unit tests
Config, ConfigTOML, ConfigTOMLW, ConfigYAML
moppi folder, config.py
.env/bin/moppi
add / install / i, remove / delete / r
Has an explicit package dependecy tree. Inspired by yarn and go/mod.
Packages stored in pyproject.toml file or in moppi.yaml
In pyproject.toml add [tools.moppi.dependency-lock]
manage dependencies directly in pyproject.toml? direct-dependencies and indirect-dependencies
Package format is either python or yaml(with anchors) or json - toml + yaml
upgrade
apply
add and remove should work for list of packages
uninstall
make public, upload to pipy
python -m moppi support
CLI support
connect to venv
yaml load
yaml dump indirect
dependencies
yaml dump
dev packages
indirect packages

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

moppi-0.4.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

moppi-0.4.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file moppi-0.4.0.tar.gz.

File metadata

  • Download URL: moppi-0.4.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for moppi-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c8b11ca2060ecc8e1548bdb2c28135f2110dd7388acd9a8675dd9b56f9bdf60a
MD5 fc081524915eecbb7a51e7eacc44b9e9
BLAKE2b-256 ce574223dedd5a98c4a3da64bd6c0e5706d307db2c3c9eb918c1012d55b2800c

See more details on using hashes here.

File details

Details for the file moppi-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: moppi-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for moppi-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba6138421423981d56decdd9ab41b90326b1faf4125adeceb29e1b9501775cc7
MD5 09a2ad8785f9efabf0aebea086458e8f
BLAKE2b-256 05997ad9fefcdd14c2bed36ba46a3a178d3eefd34452eeb88676ab5a7a3e0bce

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