package_control icon indicating copy to clipboard operation
package_control copied to clipboard

How to create a dependency for python 3.8?

Open evandrocoan opened this issue 1 year ago • 4 comments

I have a package https://github.com/evandrocoan/RememberCommandPaletteInput which defined the .python-version file. When package control 4 try to install it, it says "depname is not available for Python 3.8". If I remove my .python-version file, the package dependencies are installed normally.

The documentation at https://packagecontrol.io/docs/dependencies does not mention the need of .python-version for dependencies. Does my dependencies need to have the .python-version file also?

evandrocoan avatar Feb 01 '24 00:02 evandrocoan

I opened pull-request #1664 fixing reading 'python_versions' from channel data. But is there a simpler way to set a dependency as Python 3.8?

evandrocoan avatar Feb 02 '24 01:02 evandrocoan

Dependencies were a special kind of packages to wrap python packages. Any ordinary plugin-like functionality was possible due to their location, but not intentional use.

A proper depedency looks like https://github.com/packagecontrol/example-dependency

Package Control 4 replaces dependencies by libraries with latter ones being ordinary python packages installed to $data/Lib. Dependencies are migrated during upgrade from PC3 to PC4, which means content of proper platform specific sub directory (e.g.: all, st3, ...) is copied to $data/Lib/<library-name> and proper .dist-info directory being created.

Same happens when installing existing dependencies.

Alternatively, ordinary python packages can be installed from pypi.org, with two restrictions:

  1. They need to be registered in a channel as PC does not implement pip like package lookup.
  2. PC 4 does not yet resolve dependencies recursively, like pip.

Example: https://github.com/packagecontrol/channel/blob/02bc2b4cd1f9739f203b9e3003fefca39e8d2a9c/repository.json#L202-L281


That said, local .python-version files are not involved. The only way to mark a dependency compatible for python 3.8 is via upstream channel data.

A concept for ordinary packages to depend on each other is probably possible, but has not been worked at, yet.

deathaxe avatar Feb 02 '24 18:02 deathaxe

Thanks. I found the schema specification and examples on the main repository. There is no need for a detailed explanation; I would just require a specification as can be found on sublime-package.json so I can know what values are accepted by each field and which fields there are available. image

It would be nice to update the official documentation to mention package control 4.0 instead of just 3.0: https://packagecontrol.io/docs/dependencies

evandrocoan avatar Feb 04 '24 17:02 evandrocoan

Yes, certainly. Unfortunately, the only person who is capable of updating packagecontrol.io is MIA.

FichteFoll avatar Feb 04 '24 19:02 FichteFoll

Alternatively, ordinary python packages can be installed from pypi.org, with two restrictions:

  1. They need to be registered in a channel as PC does not implement pip like package lookup.
  2. PC 4 does not yet resolve dependencies recursively, like pip.

By the way, is either of these fixed in or depend on the scheme-4 upgrade https://github.com/wbond/packagecontrol.io/pull/157 or are these separate future improvements?

eugenesvk avatar Jan 25 '25 06:01 eugenesvk

Package Control 4 adds a new "asset" based release type and a "pypi" client to crawl registered packages from pypi.org. Defining them requires repository/channel scheme v4, which is still not supported by packagecontrol.io at the time of writing this post.

That's the major reason for separate https://github.com/packagecontrol/channel/ being required to be able to provide python 3.8 dependencies at all.

No work has been done so far to integrade recursive dependencies resolver beyond a very naive and basic parser for python "requirements", and it won't probably be as long as Package Control still supports ST3 and python 3.3

deathaxe avatar Jan 25 '25 08:01 deathaxe