0

I try to create a zipped source python package on a linux distribution without specifying the --formats option to sdist on the command line (using an existing Jenkins pipeline which do not support this option). In the documentation here, it states:

(assuming you haven’t specified any sdist options in the setup script or config file), sdist creates the archive of the default format for the current platform. The default format is a gzip’ed tar file (.tar.gz) on Unix, and ZIP file on Windows.

But it doesn't say how should you specify sdist options in the setup script?

matovitch
  • 1,264
  • 11
  • 26

1 Answers1

2

From the linked documentation previous topic:

The basic syntax of the configuration file is simple:

[command]
option=value
...

where command is one of the Distutils commands (e.g. build_py, install), and option is one of the options that command supports

and later an example for build_ext --inplace

[build_ext]
inplace=1

That means that you must write into the setup.cfg file:

[sdist]
formats=zip

Beware: untested because I have no available Python2...

Mike T
  • 41,085
  • 18
  • 152
  • 203
Serge Ballesta
  • 143,923
  • 11
  • 122
  • 252
  • Sorry for being lazy on this one and thank you for your help. Reading the documentation I get a sense that this should be doable inside the `setup.py` but having a config file is probably cleaner. – matovitch Oct 05 '20 at 09:41