Cog-Creators / Cog-Creators/Red-DiscordBot

[v3 Downloader] RFC: installing cogs/shared libs from PyPI + cog discovery

Open
#1,968 4 comments 0 reactions 1 assignee Claimed by @calebj View on GitHub
Category: Cogs - Downloader Status: Frozen Type: Feature
Dominant language
Python
Stars
5.7k
Forks
2.5k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

# Feature request

#### Select the type of feature you are requesting:
- [x] Core (Downloader)

#### Describe your requested feature
Since redbot can be installed directly using `pip`, and will be usable without `git` once discord.py v1.0+ hits PyPI, I think that Red should support cogs or cog collections installed as python packages.

Fine-grained management via Downloader (beyond just calling `[p]pipinstall`) would be nice to have, but using [setuptools plugin discovery](https://packaging.python.org/guides/creating-and-discovering-plugins/#using-package-metadata) ([docs](https://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins)) is a good first step.

#### Benefits:
- Dependency management and updates are already handled
- Supports variants/dependencies for specific OSes or via [setuptools "extras"](https://setuptools.readthedocs.io/en/latest/setuptools.html#id16)
- Versioning, stability level and other metadata is well-defined
- Cog installation can be done in one step using `pip install`, without adding any repos
- Cogs can support pre-compiled native code packaged as a wheel
- Release pipelines are easier to set up

#### Current issues:
1. Package discovery for normal packages is independent of repo contents
- packages not installed will not appear during discovery
- sources of cog list/metadata could be a "base" package, or cogs.red.
- base package would have to be updated when cogs are added/removed, description changes, etc.
- cogs.red would have to perform discovery (or just rescan when a webhook fires)
2. PyPI has no tag/classifier for Red ([yet](https://github.com/pypa/warehouse/issues?q=is%3Aissue+is%3Aopen+label%3A%22classifier+request%22))
3. Hybrid repositories
- setup.py reading from info.json?
- repo manager should tolerate namespace packages in git repos
- installation may need to parse requirements.txt instead of JSON requirements array

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.