Home  Python   Manifest fi ...

manifest file in Python

Purpose of the MANIFEST.in File

The MANIFEST.in file allows you to specify which files should be included in the source distribution of your package. When you run the setup.py sdist command, Python’s setuptools or distutils reads this file and includes the specified files in the created tarball or zip file.

Example MANIFEST.in Content and Explanation

Let's break down the example MANIFEST.in file:

include selenium/selenium.py
include selenium/__init__.py
include selenium/py.typed
include selenium/webdriver/common/linux/selenium-manager
include selenium/webdriver/common/macos/selenium-manager
include selenium/webdriver/common/windows/selenium-manager.exe
include CHANGES
include README.rst
include LICENSE

Explanation of Each Line

Why Include These Files?

Python Source Files and Package Metadata:

Executables:

Documentation and Licensing:

How MANIFEST.in Works with setup.py

The MANIFEST.in file works in conjunction with the setup.py script. Here’s a simple example of how the setup.py might look:

from setuptools import setup, find_packages

setup(
    name='selenium',
    version='4.0.0',
    packages=find_packages(),
    include_package_data=True,  # This is important to ensure MANIFEST.in is respected
    ...
)
Published on: Jun 27, 2024, 04:46 AM  
 

Comments

Add your comment