简体   繁体   中英

Correct build python PIP package

How to process the correct build of my application to PIP? I have done everything like a need in the documentation and it works, but after I have updates and my scripts changed from one to few (started from " main .py" script which imported others).

And my build process is broken now. How I able to fix this?

setup.py

import setuptools

with open("README.md", "r") as fh:
    long_description = fh.read()

setuptools.setup(
     name='tests',  
     version='0.0.2',
     scripts=['tests'] ,
     author="Test",
     author_email="test@test.com",
     description="TEST",
     long_description=long_description,
   long_description_content_type="text/markdown",
     url="https://test.com",
     packages=setuptools.find_packages(),
     classifiers=[
         "Programming Language :: Python :: 3",
         "License :: OSI Approved :: MIT License",
         "Operating System :: Unix"
    ],
 )

Where "platops" is a directory with scripts.

Error

error: [Errno 21] Is a directory: 'tests'

How to correct build this?

It seems like you can't add a directory in scripts=[] . You can read up on it here . You will probably need to specify the relative path to each one.

From the docs:

Scripts are **files** containing Python source code, intended to be 

started from the command line.

Edit: You could also try using globbing:

scripts=['scripts/*']

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM