Install .desktop file with setuptools and pyproject.toml

196 views Asked by At

I have a GUI Python app that I'm trying to distribute a desktop entry with. Normally, one would write a setup.py with setuptools that has this in it:

from setuptools import setup

setup(
    name       = 'myapp',
    version    = '0.0.1',
    packages   = ['myapp'],
    data_files = [
        ('share/applications', ['myapp.desktop']),
    ],
)

This is deprecated, however, and my goal is to use only pyproject.toml in my repo with no setup.py or setup.cfg needed. I have been unable to find any information on how I would go about doing this.

1

There are 1 answers

0
McBig On

If you are using setuptools which is fallback for now, you can use this in your pyproject.toml:

[tool.setuptools.data-files]
"share/applications" = ["myapp.desktop"]