Sublime Forum

Create Package File Not working

#1

I have made plugin and placed under ‘Packages’ folder.

All its feature are working fine no issues at all, my plugin requires python 3.8 so created the .python-version with 3.8 in it in the root of my plugin folder.

But now i want to create its .sublime-package everytime i hit Create Package File it gives error on type hinting and f strings, which is weird since its supported on python 3.8 and my plugin is also working fine.

Example error

Traceback (most recent call last):
  File "./python3.3/compileall.py", line 115, in compile_file
  File "./python3.3/py_compile.py", line 125, in compile
py_compile.PyCompileError:   File "/Users/abhishek/Library/Application Support/Sublime Text 3/Packages/pyrock/src/commands/admin.py", line 41
    response: Optional[Dict] = Network.get(...)
            ^
SyntaxError: invalid syntax

From error it looks like its still using python 3.3 to compile the package.

0 Likes

#2

Package Control 3.x supports python 3.3 only. It doesn’t know anything about python 3.8 being an option.

Unfortunatelly, compiler is always invoked, even for default package profile, which excludes compiled modules. Thus any python 3.8+ source is not supported.

0 Likes

#3

So what are my options here?

The plugin is working fine, its just that i am not able to Create package for it.

0 Likes

#4

Just zip the content of your package’s folder, name the archive <Package Name>.sublime-package.

Shipping compiled modules is however not easily possible, without manually creating a plugin, which compiles code using python 3.8.

Note: Package Control downloads archives from ordinary upstream code repositories and installs them as sublime-package file.

0 Likes

#5

Its giving this error now

Error loading /Users/abhishek/Library/Application Support/Sublime Text 3/Installed Packages/pyrock.sublime-package: File is not a zip file
0 Likes