Why does “python setup.py sdist” create unwanted “PROJECT-egg.info” in project root directory?

前端 未结 4 823
我在风中等你
我在风中等你 2020-12-15 02:57

When I run

  python setup.py sdist

it creates an sdist in my ./dist directory. This includes a \"PROJECT-egg.info\" file in the zip inside

4条回答
  •  无人及你
    2020-12-15 03:14

    Note that you can have the PROJECT.egg-info artifacts disappear completely from your sdist.

    The command setup.py egg_info will use the source root as the egg base by default, resulting in the PROJECT.egg-info directory being packaged into the sdist.

    You can configure the egg base by passing the option --egg-base. This will create the PROJECT.egg-info directory somewhere else, leaving it out of your source distribution completely. You might also use a setup.cfg to set that property.

    The following command to create a sdist without a PROJECT.egg-info works for me:

    python setup.py egg_info --egg-base /tmp sdist
    

    Or in a setup.cfg:

    [egg_info]
    egg_base = /tmp
    

提交回复
热议问题