Build Wheel: From setup.py to pyproject.toml. I had scripts but now I don't know how to put it as project.scripts. Take my code as an example

46 views Asked by At

Before using setup.py I used to do python setup.py bdist_wheel to build the wheel. Now I want to use pyproject.toml. In setup.py I had

setuptools.setup(
    name="somename",
    # ...
    scripts=['bin/somefile'],
    # ...
)

Now in pyproject.toml I typed

[project.scripts]
my-script = "bin/somefile:start"

My somefile is as follows

#!/usr/bin/env python

import sys
# ...
from somepackage.server import start
import argparse

# Initiate the parser
parser = argparse.ArgumentParser(description='somedescription')
args = parser.parse_args()

start(args)

So I think I'm a bit lost here, the error I get is

configuration error: `project.scripts.my-script` must be python-entrypoint-reference

First time using pyproject.toml, so I don't know what should I type there

0

There are 0 answers