Sublime Forum

Trouble Submitting New Package

#1

Hi!

I am on a Windows 10 x64 machine with Sublime Text build 4200. Everything has been working perfectly for along time.

I have a package developed (duplicating a much-loved feature from my old editor Multi-Edit) that I want to submit and make part of the publicly-available package list, so I went through the steps on the Submitting a Package - Package Control page, but when I get to step 7 (Run the Tests), I

  1. installed the ChannelRepositoryTools package via Package Control, and
  2. ran the ChannelRepositoryTools: Test Default Channel command from the command palette,

but no matter what I do, I get this error message:

image

I tried:

  1. dragging the cloned fork of package_control_channel repository into the FOLDERS,
  2. ensuring that folder was the only one open, and
  3. opening the project package_control_channel.sublime-project, and ensuring the package_control_channel folder was the only thing opened,
  4. having the contained respository.json file the current file when I ran it,
  5. having the contained respository.json file the current file when I ran ChannelRepositoryTools: Test Local Repository (Current File)
  6. repeating (4) with channel.json, and
  7. repating (5) with channel.json,

but I still get the same error message in all cases.

To show that I have the folder open from my locally-cloned fork:

So I tried debugging it by installing an override package folder Packages\ChannelRepositoryTools from the ChannelRepositoryTools package contents (validating that all files match the contents of https://github.com/wbond/ChannelRepositoryTools) and adding some print() statements in the execution path of the TestDefaultChannelCommand (clearly it is failing in the find_channel_folder() function), but no matter what I tried, when this override folder is in place, the Tools > Command Pallette... > ChannelRepositoryTools: list is now limited to ChannelRepositoryTools: Upgrade Repository Schema (Current File). The other commands do not appear!

Even if I remove the Sublime Text\Installed Packages\ChannelRepositoryTools.sublime-package file and re-start Sublime Text, the behavior remains the same. It is as though something internal to Sublime Text is suppressing the list of ChannelRepositoryTools: commands to just the one stated above. I even tried renaming the Default.sublime-commands to ChannelRepositoryTools.sublime-commands and re-starting Sublime Text, but nothing changes the behavior: as long as the override package folder Packages\ChannelRepositoryTools is present, all but one of the ChannelRepositoryTools: commands is suppressed, and when I remove it and instead run on the Sublime Text\Installed Packages\ChannelRepositoryTools.sublime-package file, all the commands are there, but they issue the above error message and I don’t seem to have a way to debug it.

I even tried putting the test_default_channel command in a test utility I have and binding it with a key. The results:

  • if the Sublime Text\Installed Packages\ChannelRepositoryTools.sublime-package file is in place, it runs the command and produces the same error message (shown above), and
  • if the override package folder Packages\ChannelRepositoryTools is in place, nothing happens.

Help!

0 Likes

#2

Findings:

I copied the relevant code out of ChannelRepositoryTools\tests.py and found that it is failing looking for the file tests/test.py, which is indeed, not present in the package_control_channel repository!

This comes from line 142 of ChannelRepositoryTools\tests.py (3rd element in list of strings):

        for file_name in ['channel.json', 'repository.json', 'tests/test.py']:

This is a bug!

Submitted issue in (I believe) the correct repository: https://github.com/sublimehq/package_control_channel/issues/9272 with accompanying PR to fix.

I also submitted an issue here because it remains to be determined which repository needs to be changed. If the other repository indeed no longer needs its tests/ folder, then this repository’s tests.py needs to be modified not to require it.

cc: @wbond

0 Likes

#3

Having submitted one or two packages, already, I must confess to never having been using ChannelRepositoryTools for any of them.

The tests/test.py file being missing is a result of some recent refactorings, which out-sourced json schema tests and repository review to dedicated github actions, as some of those functionality might be generally useful for any 3rd-party repository or channel.

The default channel’s repository was moved, recently. Thus displayed repo url https://github.com/wbond/package_control_channel is no longer valid. It may most likely however be redirected automatically to https://github.com/sublimehq/package_control_channel.

Long story short, it appears CRT needs adjustments to recover its functionality.

With LSP, LSP-json and Package Control 4, installed, however we have full auto-completion, linting and validation of channel and repository json files in place, at least helping to avoid technically malformed submissions.

Anything else is revealed by CI when opening or updating PRs.

0 Likes

#4

Good morning, @deathaxe! And Merry Christmas!

Thank you for filling in the gaps for me. That explains a few things for sure. I knew exactly where the CRT adjustment needs to be made, and so I initially submitted a PR on that, but then realized that CRT ran the tests in package_control_channel's now-deleted tests/ folder. So I closed my PR that as well. Accordingly, I have closed my PR in package_control_channel that allowed CRT to run, since it appears that what REALLY happened was the change in moving the tests to CI made CRT obsolete, unless it gets modified to import and run the new CI tests. Alas, the REAL culprit is step 7 in this web page: https://packagecontrol.io/docs/submitting_a_package/ .

Re the redirected package-control_channel, indeed, you are correct, as my package submission has reached the latter, despite my not having known about it.

I like that CI is being used for those checks. It’s a convenient way to keep requirements changes in 1 place. That also explains why running CRT was not on the checklist that appears with the PR.

As a note, once I got CRT running, I noticed that 2 months ago, one of the package authors moved 4 of his packages to https://codeberg.org. CRT failed his packages on that point, but it appears they were merged into package-control_channel. Can I assume then that https://codeberg.org is also now a valid host for Sublime Text packages?

Kind regards,
Vic

P.S. Do you understand why when I moved the contents of Sublime Text\Installed Packages\ChannelRepositoryTools.sublime-package to unzipped version in Packages\ChannelRepositoryTools\ that the all but one of the ChannelRepositoryTools: commands were no longer visible in the Command Palette?

0 Likes