{"id":13815588,"url":"https://github.com/njsmith/posy","last_synced_at":"2025-04-04T15:11:57.082Z","repository":{"id":65418252,"uuid":"376533981","full_name":"njsmith/posy","owner":"njsmith","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-01T04:38:11.000Z","size":569,"stargazers_count":288,"open_issues_count":14,"forks_count":17,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-10-13T09:30:01.268Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/njsmith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-13T12:09:53.000Z","updated_at":"2024-09-23T13:32:52.000Z","dependencies_parsed_at":"2024-01-25T01:39:19.110Z","dependency_job_id":"b902e663-cb35-4325-85ea-90de5adecd4a","html_url":"https://github.com/njsmith/posy","commit_stats":{"total_commits":213,"total_committers":6,"mean_commits":35.5,"dds":"0.16901408450704225","last_synced_commit":"61ff56c68a6aeff744b274170c32f59ac9ac20e1"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njsmith%2Fposy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njsmith%2Fposy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njsmith%2Fposy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njsmith%2Fposy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/njsmith","download_url":"https://codeload.github.com/njsmith/posy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198469,"owners_count":20900081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T04:03:37.943Z","updated_at":"2025-04-04T15:11:57.065Z","avatar_url":"https://github.com/njsmith.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# What is this?\n\nYou have a few choices:\n\n- Me messing around in Rust for fun (just a hobby, won't be big and\n  serious like `pip`)\n  \n- An incomplete but functional implementation of Python's packaging\n  standards in Rust, including a full resolver based on [the PubGrub\n  algorithm](https://nex3.medium.com/pubgrub-2fb6470504f) (as provided\n  by [`pubgrub`](https://docs.rs/pubgrub/).\n\n- A [draft\n  spec](https://github.com/njsmith/posy/blob/main/pybi/README.md) for\n  \"PyBi\" files, which are like wheels but for Python interpreters.\n  \nSomeday:\n\n- A project-oriented Python workflow manager, designed to\n  make it easy for beginners to write their first Python script or\n  notebook, and then grow with you to developing complex standalone\n  apps and libraries with many contributors.\n  \n- A combined replacement for pyenv, deadsnakes, tox, venv, pip,\n  pip-compile/pipenv, and PEP 582, all in a single-file executable\n  with zero system requirements (not even Python).\n\n- An 🐘\n  [elephant](https://mail.python.org/archives/list/distutils-sig@python.org/thread/YFJITQB37MZOPOFJJF3OAQOY4TOAFXYM/#YFJITQB37MZOPOFJJF3OAQOY4TOAFXYM)\n  🐘\n\n\n# The Vision\n\nThe goal is for posy to act as a kind of high-level frontend to python: you\ninstall posy, then run `posy [args] some_python.py` and it takes care of\neverything up until entering the python interpreter. That includes:\n\n- installing Python (posy is a pure-rust single-file binary; it doesn't assume\n  you have anything else installed)\n- installing dependencies from wheels/sdists (it's a PEP 517 build \"frontend\")\n- environment management \n- (cross-platform) locking (for both the interpreter + packages)\n- run commands in environment, or export a self-contained redistributable\n  environment (e.g. to drop in a docker image)\n- nice UX for setting this stuff up and managing it, hopefully\n\n(NOTE: not all of these are implemented yet!)\n\nBut the following is *not* in scope:\n\n- a PEP 517 build *backend*: use setuptools, flit, meson-python, py-build-cmake,\n  ...or whatever build framework you want. Or none at all, if you're not\n  creating a redistributable package.\n\n  [XX TODO: insert link to pypi search once we [have a\n  classifier](https://discuss.python.org/t/improving-discoverability-of-build-backends/20140/)\n  so we don't have to play favorites on which projects we list here.]\n\n- a testing framework, a code formatter, a linter, ... Python already has good\n  tools for all that stuff, and we don't plan to duplicate them. But posy can\n  set up the environment they need and run them for you!\n\n\n# Packaging features I don't (currently) plan to implement\n\n### `===`\n\nPEP 440 defines a `===` operator, for comparing non-PEP 440-compliant versions.\nPosy only supports PEP 440-compliant versions.\n\n\n### The `platform_release` and `platform_version` environment marker variables\n\nThese are values like:\n\n```\n 'platform_release': '5.19.0-23-generic',\n 'platform_version': '#24-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 14 15:39:57 UTC 2022',\n```\n\nTechnically, you're supposed to be able to make dependencies vary depending on\nthese strings. But these are so quirky and machine-specific that I don't see how\nto implement that in posy's model, or why anyone would want them.\n\n\n### Prereleases in specifiers\n\nAccording to PEP 440, specifiers like `\u003e= 2.0a1` are supposed to\nchange meaning depending on whether or not the literal version\ncontains a prerelease marker. So like, `\u003e= 2.0` *doesn't* match\n`2.1a1`, because that's a prerelease, and regular specifiers never\nmatch prereleases. But `\u003e= 2.0a1` *does* match `2.1a1`, because the\npresence of a prerelease in the specifier makes it legal for\nprerelease versions to match.\n  \nI don't think I can actually implement this using the `pubgrub`\nsystem, since it collapses multiple specifiers for the same package\ninto a single set of valid ranges, and there's no way to preserve the\ninformation about which ranges were derived from specifiers that\nincluded prerelease suffixes, and which ranges weren't.\n  \nAnd if you think about it... that's actually because while this rule is\nwell-defined for a specifier in isolation, it doesn't really make sense when\nyou're talking about multiple packages with their own dependencies. E.g., if\npackage A depends on `foo == 2.0a1`, and package B depends on `foo \u003e= 1.0`, then\nis it valid to install foo v2.0a1? It feels like it ought to match all the\nrequirements, but technically it doesn't... according to a strict reading of PEP\n440, once any package says `foo \u003e= 1.0`, it becomes impossible to ever use a\n`foo` pre-release anywhere in the dependency tree, no matter what other packages\nsay. Pre-release validity is just inherently a global property, not a property\nof individual specifiers.\n  \nSo I'm thinking we should use the rule:\n\n- If all available versions are pre-releases, then pre-releases are valid\n- If we're updating a set of pins that already contain a pre-release,\n  then pre-releases are valid (or at least that specific pre-release\n  is)\n- Otherwise, to get pre-releases, you have to set some\n  environment-level config like `allow-prerelease = [\"foo\"]`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnjsmith%2Fposy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnjsmith%2Fposy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnjsmith%2Fposy/lists"}