1

I've taken a look at How to include docs directory in python distribution which shows the following examples:

include docs/*
recursive-include docs *

But then looking at Including files in source distributions with MANIFEST.in I see:

include pat1 pat2 ...

My understanding so far is given this directory structure:

a/
  b.txt # File 1
b.txt # File 2
  • include a/b.txt results in only file 1 being included.
  • include a b.txt results in both file 1 file 2 being included (because all of a is included).

Is this right?

Mario Ishac
  • 5,060
  • 3
  • 21
  • 52
  • 1
    Shouldn't it rather be `include a/* b.txt`? You need to use _glob-style patterns_. Or if you prefer for files similar to _File 1_ use: `recursive-include a *.txt`. – sinoroc Aug 27 '20 at 08:16
  • @sinoroc would `include a/* *.txt` achieve same thing as `recursive-include a *.txt`? Not sure when to put the `*` after `a/` or before `.txt`. – Mario Ishac Aug 27 '20 at 16:05
  • 1
    No, it's not the same thing. You should get familiar with _glob-style patterns_. As far as I understood, `recursive-include a *.txt` would include all files whose name end with `.txt` in the directory `a` and all its subdirectories. – sinoroc Aug 27 '20 at 17:30
  • 1
    And `include a/* *.txt` would **1** (a/*) include all files (no matter the name) from the directory `a` (not in the sub-directories), and **2** (*.txt) all files from the current directory (not the sub-directories) whose name end with `.txt`. – sinoroc Aug 27 '20 at 17:39

0 Answers0