Code Monkey home page Code Monkey logo

plz's Introduction

PLZ

CI

Use

$ plz install pre-commit   # Install 1 or more packages
$ plz uninstall pre-commit # Uninstall 1 or more packages
$ plz reinstall pre-commit # Reinstall 1 or more packages
$ plz download pre-commit  # Download 1 or more packages
$ plz hash file.py         # Show SHA CheckSum of file/package
$ plz init                 # New Python project template (Interactive)
$ plz stats                # PyPI official service status report
$ plz newpackages          # List all the new Packages uploaded to PyPI recently
$ plz lastupdates          # List all existing Packages updated on PyPI recently
$ plz lastjobs             # List all new Job Posts updated on Python recently
$ plz userpackages         # List all existing Packages by User (Interactive)
$ plz latestversion        # Show the Latest Version of a PYPI Package (SemVer)
$ plz forceInstallPip      # Force install PIP on arbitrary folder (get-pip.py)
$ plz doc file.md          # Markdown/ReSTructuredText to HTML  (MD/RST can be mixed).
$ plz doc2latex file.md    # Markdown/ReSTructuredText to Latex (MD/RST can be mixed).
$ plz doc2json file.md     # Markdown/ReSTructuredText to JSON  (MD/RST can be mixed).
$ plz upload packg-1.0.zip # Similar to "twine upload" (Interactive,asks user,wont need Twine).
$ plz parserequirements    # Parse a requirements file, print it to stdout (Linter,Debug,etc).
$ plz fakecommits          # Generate "Fake" Git commits (Restart CI,trigger GitHub Actions,etc).
$ plz bug                  # Python Bug Report Assistant (Interactive).
$
$ plz --python="/path/to/python"  # Full path to a Python executable to use, defaults to autodetect.
$ plz --dotenv="/path/to/.env"    # Full path to a Type-safe DotEnv file.
$ plz --cleanpyc           # Clean all __pycache__ and *.pyc
$ plz --cleanpypackages    # Clean all __pypackages__
$ plz --cleantemp          # Clean all temporary folder.
$ plz --cleanpipcache      # Clean all PIP Cache folder.
$ plz --cleanvenvs         # Clean Virtualenvs (interactive, asks Y/N 1-by-1).
$ plz --publicip           # Show your Public IP Address (Internet connectivity check).
$ plz --log=file.log       # Full path to a verbose local log file.
$ plz --putenv:key=val     # Set an environment variable "KEY=Value", can be repeated.
$ plz --suicide            # Deletes itself permanently and exit (single file binary).
$ plz --dump               # Show system info JSON and quit (for Developers and Bug Reporting).
$ plz --version            # Show Version
$ plz --help               # Show Help

Interactive Python Project Creator

Requirements Parser for debug

Type-safe DotEnv

Type-safe .env file is just a .env but Typed.

Types are enforced via a comment, so it is still a "vanilla" .env.

Type-safe .env file can be used with unsafe .env parsers, legacy parsers will ignore the comment.

Keys must be a non-empty ASCII string [a-zA-Z0-9_], keys are validated. Key-Value separator must be =.

Parses the same .env file from the vanilla implementation tests.

Several orders of magnitude faster than the vanilla implementation. Implementation is ~ 50 lines of code.

Example:

# This is a comment
DB_HOST=localhost  # string
DB_USER=root       # string
DB_PASS="123"      # string
DB_TIMEOUT=42      # int
DELAY=3.14         # float
ACTIVE=true        # bool

Features

  • Python 1.x, 2.x, 3.x support.
  • Private PYPI custom URL.
  • No configurations needed.
  • No PATH pollution.
  • No dependency on system PIP, no dependency on system Python.
  • 1 Megabyte, 0 Dependencies.
  • Designed for Docker or Alpine usage.
  • Install, uninstall, reinstall, download, upload to PyPI, etc.
  • Real Inferred Strong Static Typing.
  • No Garbage Collector (Rust-like memory management).
  • Immutable programming, No Global Mutable State.
  • The only PIP alternative in the world that just works even with PIP/Python/Virtualenv completely broken.
  • Compiled machine code performance, as fast as optimized hand crafted C.
  • High performance with low resources (RPi, VPS, cloud, old pc, etc).
  • Single file binary, it can even delete itself after use.
  • No Installs, no setups, just copy & paste and run (even on Alpine).
  • Colored output on the Terminal.
  • Project skeleton creator to create your own new Python projects.
  • Wont save any passwords, databases, keys, secrets, to disk nor Internet.
  • No temporary folders nor files.
  • Not meant as a drop-in replacement for anything pre-existing.
  • Tiny single file source code (not counting string static constants).
  • Self-Documentation Generator outputs HTML, PDF, JSON.
  • Works fully independently self-contained standalone application.
  • Fast startup time.

WIP:

Uninstall

  • Delete it.

Dependencies

  • It does NOT depend on pip (Not a pip wrapper), it can work with pip completely broken.

Requisites

  • Python 64Bit.

FAQ

  • How to use a Private PYPI custom URL ?.

Compile adding the argument -d:pypiApiUrl="http://url-here.io".

  • This requires Cython ?.

No.

  • This is a drop-in replacement of X ?.

No.

  • Whats "Generate Fake Git Commits" ?.

Sometimes you may need to create commits to restart CI, trigger GitHub Actions, Git Hooks, etc but you dont have anything new to commit, that feature can create empty commits to force-trigger the Git service.

Some Git services do not trigger for new repos with 1 or 2 commits, that feature can create empty commits to force-start the Git service.

Python Bugs

From XML-RPC API Server-side this endpoints wont work anymore (Not my Bug):

  • release_downloads, top_packages, updated_releases, changed_packages.
  • Sometimes PYPI returns Python Tracebacks as strings on the body of the response.
  • We tried to implement fully parallel install of packages, but because of the way Python packages work, they need to be installed sequentially whatsoever.

Stars

Stars over time

Notes

Quote from PIPEnv Project:

pipenv release cadence came to a super dramatic halt because of a lot of upstream issues (pip broke, setuptools broke, then pip and setuptools both released breaking fixes, and we have about 15 dependencies which I personally maintain).

Quote from PIP Project:

Due to lack of interest and maintenance, 'pip bundle' and support for installing files is now deprecated.

Important, near year 2021, the PyPI server started responding empty responses and error messages, but with HTTP status 200 OK, to PIP alternatives that are not the official PIP, the error message said HTTPTooManyRequests: The action could not be performed because there were too many requests by the client. Limit may reset in 1 seconds. and your client has to wait >1 second per request, even for empty responses, and sometimes retries fail anyway, this looks kinda intentional, maybe to make it look like PIP is the fastest or something like that ?.

All Python tools dropped support for Python 2.7 and 3.5, some only support 3.8 as of ~2021.

As of 2021 PYPI says that the Search API of XML RPC is now "permanently disabled" https://status.python.org/incidents/grk0k7sz6zkp

PIP breaks after upgrades pypa/pip#5599

Send Crypto

Bitcoin BTC

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e

BTC Bitcoin Network

1Pnf45MgGgY32X4KDNJbutnpx96E4FxqVi
Ethereum ETH Dai DAI Uniswap UNI Axie Infinity AXS Smooth Love Potion SLP

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e

ERC20 Ethereum Network

0xb78c4cf63274bb22f83481986157d234105ac17e
Tether USDT

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e

ERC20 Ethereum Network

0xb78c4cf63274bb22f83481986157d234105ac17e

TRC20 Tron Network

TWGft53WgWvH2mnqR8ZUXq1GD8M4gZ4Yfu
Solana SOL

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e

SOL Solana Network

FKaPSd8kTUpH7Q76d77toy1jjPGpZSxR4xbhQHyCMSGq
Cardano ADA

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e

ADA Cardano Network

DdzFFzCqrht9Y1r4Yx7ouqG9yJNWeXFt69xavLdaeXdu4cQi2yXgNWagzh52o9k9YRh3ussHnBnDrg7v7W2hSXWXfBhbo2ooUKRFMieM
Sandbox SAND Decentraland MANA

ERC20 Ethereum Network

0xb78c4cf63274bb22f83481986157d234105ac17e
Algorand ALGO

ALGO Algorand Network

WM54DHVZQIQDVTHMPOH6FEZ4U2AU3OBPGAFTHSCYWMFE7ETKCUUOYAW24Q
Binance

https://pay.binance.com/en/checkout/e92e536210fd4f62b426ea7ee65b49c3

Lemon

LemonTag

$juancarlospaco

⬆️ ⬆️ ⬆️ ⬆️

plz's People

Contributors

juancarlospaco avatar kunitoki avatar uninhm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

plz's Issues

Language

Weird question, why does GitHub insist this project is 100% Python when it's 100% Nim? I only found one python file and it's empty. (/plz.py)

Maybe you should remove the "100% Python" badge on the README? I thought it was written in pure Python until I read that there is no garbage collector.

Python packages with dash - are not removable

$ python -m pip install break-my-python
Collecting break-my-python
  Downloading break_my_python-0.0.2-py2.py3-none-any.whl (4.4 kB)
Installing collected packages: break-my-python
Successfully installed break-my-python-0.0.2

$ plz uninstall break-my-python
Uninstall 1 Packages:	@["break-my-python"]

$ ls -l lib/python3.10/site-packages/
__pycache__
_distutils_hack
break_my_python-0.0.2.dist-info
break_my_python.pth
break_my_python.py
distutils-precedence.pth
pip
pip-22.2.2.dist-info
pkg_resources
setuptools
setuptools-65.4.1.dist-info

sitePackages variable is not the one you expect at runtime

The global constant sitePackages is determined from the host at compile time, and will not report the correct site packages if you run plz from within a virtualenv. The value should be coming from runtime and should be determined from an heuristic.

  sitePackages = staticExec"""python3 -c "print(__import__('site').getsitepackages()[0])" """ ## https://stackoverflow.com/questions/122327/how-do-i-find-the-location-of-my-python-site-packages-directory#12950101

Compilation error on nim 1.6.8 / 1.6.10

/Users/kunitoki/nim/plz/src/plz/docgen.nim(21, 36) Error: type mismatch: got <string, string, int literal(1), int literal(1), bool, set[RstParseOption]>
but expected one of:
proc rstParse(text, filename: string; line, column: int;
              options: RstParseOptions; findFile: FindFileHandler = nil;
              msgHandler: MsgHandler = nil): tuple[node: PRstNode,
    filenames: RstFileTable, hasToc: bool]
  first type mismatch at position: 5
  required type for options: RstParseOptions
  but expression 'option' is of type: bool

expression: rstParse(readFile(filename), "", 1, 1, option,
         {roSupportSmilies, roSupportRawDirective, roSupportMarkdown})
     Error: Build failed for package: plz
        ... Execution failed with exit code 256
        ... Command: /Users/kunitoki/.nimble/bin/nim c --colors:on --noNimblePath -d:NimblePkgVersion=0.0.1 -o:/Users/kunitoki/nim/plz/plz /Users/kunitoki/nim/plz/src/plz.nim
```

Install doesn't properly install

Love the idea ! Great work !

I've tried running install and i just get eggs in site-packages, not the unpacked python modules and .dist-info folder.

This also makes it impossible to uninstall (no .dist-info in site-packages if installed via plz, but it is if installed via pip).
It also assumes that package names are case insensitive (for example if i do plz uninstall flask it doesn't find it because it was installed in Flask.*.dist-info):

  for a in args: # RECORD Metadata file (CSV without file extension).
    for item in walkFiles(sitePackages / a & "*.dist-info" / "RECORD"):
      recordFiles.add item

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.