{"id":15576586,"url":"https://github.com/abn/pep621-project-dependencies","last_synced_at":"2025-10-25T07:50:31.646Z","repository":{"id":149541983,"uuid":"293350817","full_name":"abn/pep621-project-dependencies","owner":"abn","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-07T10:31:08.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-30T18:38:08.823Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/abn.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":"2020-09-06T19:48:19.000Z","updated_at":"2020-09-07T10:31:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"a1a6b008-594e-4435-ab56-f31a77a3506d","html_url":"https://github.com/abn/pep621-project-dependencies","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abn/pep621-project-dependencies","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abn%2Fpep621-project-dependencies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abn%2Fpep621-project-dependencies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abn%2Fpep621-project-dependencies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abn%2Fpep621-project-dependencies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abn","download_url":"https://codeload.github.com/abn/pep621-project-dependencies/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abn%2Fpep621-project-dependencies/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280923472,"owners_count":26414234,"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","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-02T18:52:38.437Z","updated_at":"2025-10-25T07:50:31.631Z","avatar_url":"https://github.com/abn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PEP 621 Dependency Specification: TOML Proposal Library\n\nThis is a library demonstrating loading proposed TOML dependency specification from and to \n[PEP 508](https://www.python.org/dev/peps/pep-0508/) strings for [PEP 621](https://www.python.org/dev/peps/pep-0621).\n\nThe library also implements a sample dataclass based instances with validation for dependency specifications. As an \nadditional example, this also makes use of [lark-parser](https://github.com/lark-parser/lark) to parse a provided PEP 508\nstring. \n\nThis is not supported code, this is put together for demonstration purposes only.\n\n## Example Usage\n### From PEP 508 to TOML\n#### Versioned Dependencies\n```console\n$ python -m pep621_project_dependencies -f toml \"pycowsay (==0.0.0.1)\"\n[project.dependencies]\npycowsay = { version = \"==0.0.0.1\" }\n\n[project.optional-dependencies]\n\n\n$ python -m pep621_project_dependencies -f toml \"requests[security,tests] (\u003e= 2.8.1, == 2.8.*) ; python_version \u003c '2.7'\"\n[project.dependencies]\nrequests = { extras = [ \"security\", \"tests\",], markers = \"python_version \u003c '2.7'\", version = \"\u003e= 2.8.1, == 2.8.*\" }\n\n[project.optional-dependencies]\n\n```\n\n#### Direct References (URL)\n```console\n$ python -m pep621_project_dependencies -f toml \"pip @ https://github.com/pypa/pip/archive/1.3.1.zip#sha1=da9234ee9982d4bbb3c72346a6de940a148ea686\"\n[project.dependencies]\npip = { url = \"https://github.com/pypa/pip/archive/1.3.1.zip\", hash = \"sha1=da9234ee9982d4bbb3c72346a6de940a148ea686\" }\n\n[project.optional-dependencies]\n\n```\n\n#### Direct References (VCS)\n```console\n$ python -m pep621_project_dependencies -f toml \"sphinx @ git+ssh://git@github.com/sphinx-doc/sphinx.git@master\"\n[project.dependencies]\n[project.dependencies]\nsphinx = { url = \"ssh://git@github.com/sphinx-doc/sphinx.git\", vcs = \"git\", revision = \"master\" }\n\n[project.optional-dependencies]\n\n$ python -m pep621_project_dependencies -f toml \"sphinx @ git+ssh://git@github.com/sphinx-doc/sphinx.git@master ; extra == 'doc'\"\n[project.dependencies]\n\n[project.optional-dependencies.doc]\nsphinx = { url = \"ssh://git@github.com/sphinx-doc/sphinx.git\", vcs = \"git\", revision = \"master\" }\n```\n\n### From TOML to PEP 508\n```console\n$ python -m pep621_project_dependencies -f pep508 tests/fixtures/complete.toml \nflask\nnumpy (~=1.18)\npycowsay (==0.0.0.1)\nsphinx @ git+ssh://git@github.com/sphinx-doc/sphinx.git@master\npip @ https://github.com/pypa/pip/archive/1.3.1.zip#sha1=da9234ee9982d4bbb3c72346a6de940a148ea686\ndocker[ssh] (\u003e= 4.2.2, \u003c 5)\nrequests[security,tests] (\u003e= 2.8.1, == 2.8.*) ; python_version \u003c '2.7'\nbackports.shutil_get_terminal_size (== 1.0.0) ; python_version \u003c '3.3'\nbackports.ssl_match_hostname (\u003e= 3.5, \u003c 4) ; python_version \u003c '3.5'\ncolorama (\u003e= 0.4, \u003c 1) ; sys_platform == 'win32'\nenum34 (\u003e= 1.0.4, \u003c 2) ; python_version \u003c '3.4'\nkeyring (\u003e=18.0.1, \u003c18.1.0) ; python_version ~= '2.7'\nkeyring (\u003e=20.0.1, \u003c21.0.0) ; python_version ~= '3.5'\nkeyring (\u003e=21.2.0) ; python_version \u003e= '3.6'\nPySocks (\u003e= 1.5.6, != 1.5.7, \u003c 2) ; extra == 'socks'\nddt (\u003e= 1.2.2, \u003c 2) ; extra == 'tests'\npytest (\u003c6) ; python_version \u003c '3.5' and extra == 'tests'\npytest (\u003e=6) ; python_version \u003e= '3.5' and extra == 'tests'\nmock (\u003e= 1.0.1, \u003c 4) ; python_version \u003c '3.4' and extra == 'tests'\n```\n\n### Validation Error\n```console\n$ python -m pep621_project_dependencies -f pep508 tests/fixtures/invalid.toml \nERROR: Invalid direct dependency (pip) specified, only vcs dependencies can request a revision\n```\n\n## TODO\n- [x] Enhance PEP 508 URI parsing to decompose revision\n- [ ] Add examples with multiple URI fragments?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabn%2Fpep621-project-dependencies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabn%2Fpep621-project-dependencies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabn%2Fpep621-project-dependencies/lists"}