Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 687868 - dev-python/setuptools-44.0.0 includes spurious files in sdist
Summary: dev-python/setuptools-44.0.0 includes spurious files in sdist
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-11 16:17 UTC by Christopher Head
Modified: 2020-03-30 05:58 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Head 2019-06-11 16:17:57 UTC
When I run “python setup.py sdist” in a source tree, .gitignore is included in SOURCES.txt and in the resulting tarball. If I run exactly the same version of setuptools—this happens with both stable (40.6.3) and unstable (41.0.1)—pip-installed in a venv, that file is *not* included in the tarball. According to the documentation[1], .gitignore should not be included in the tarball as it does not match any of the standard filename patterns (and I have not added any specification of extra data files, nor a custom manifest). So for some reason Gentoo’s setuptools is including it incorrectly.

[1] https://docs.python.org/3.7/distutils/sourcedist.html#specifying-the-files-to-distribute
Comment 1 Christopher Head 2019-06-11 16:30:56 UTC
$ emerge --info dev-python/setuptools
Portage 2.3.66 (python 3.6.5-final-0, default/linux/amd64/17.1, gcc-8.3.0, glibc-2.29-r2, 4.19.44-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.19.44-gentoo-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-gentoo-2.6
KiB Mem:    16412400 total,   5238756 free
KiB Swap:   12362176 total,  12362176 free
Head commit of repository steam-overlay: e21303b3d12a2925ea02ab40978fec14b896fb85

Timestamp of repository gentoo: Sun, 09 Jun 2019 23:04:35 +0000
Head commit of repository gentoo: 50e05b8822661d70e9ffd860724a200deb2b09b8

Head commit of repository zaber: 226a2776b418f499fcc2e9df8af1c2ba3c3ca9dc

sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.31.1 p7) 2.31.1
app-shells/bash:          4.4_p23-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.2-r1::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.5::gentoo
dev-util/cmake:           3.14.3::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.41.2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r6::gentoo
sys-devel/gcc:            8.3.0-r1::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.14-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r2::gentoo
Repositories:

steam-overlay
    location: /var/cache/repos/steam
    sync-type: git
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 1

gentoo
    location: /var/cache/repos/gentoo
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    sync-user: chead
    priority: 3
    sync-git-verify-commit-signature: true

hawk777
    location: /var/cache/repos/hawk777
    masters: gentoo
    priority: 4

zaber
<private repository details elided; nothing installed from this repo should be relevant to this bug>

Installed sets: @admin, @android, @datacenter, @desktop, @dev, @emulation, @fonts, @games, @lisp, @media, @net, @office, @vim, @web, @zaber
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE freedist"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs 4 --load-average 8 --with-bdeps y --complete-graph y -1"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fakeroot fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms sign strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.gossamerhost.com/ ftp://mirror.csclub.uwaterloo.ca/gentoo-distfiles http://gentoo.osuosl.org/"
LANG="en_CA.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_CA"
MAKEOPTS="--jobs 4 --load-average 8"
PKGDIR="/var/cache/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl alsa amd64 bzip2 cairo caps cli cxx dbus dri ffmpeg flac fontconfig fortran gtk iconv icu idn ipv6 joystick libnotify libsamplerate libtirpc multilib ncurses nls nptl ogg opengl openmp opus pam pcre readline seccomp ssl startup-notification svg theora threads truetype udev unicode vaapi vdpau vim-syntax vorbis xattr xinerama xscreensaver xv xvmc zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-CA" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="nvidia" XFCE_PLUGINS="logout menu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

dev-python/setuptools-41.0.1::gentoo was built with the following:
USE="-test" ABI_X86="(64)" PYTHON_TARGETS="python2_7 python3_6 -pypy -pypy3 -python3_5 -python3_7"
FEATURES="ipc-sandbox xattr sandbox distlocks binpkg-logs fakeroot sfperms preserve-libs userfetch multilib-strict news usersandbox pid-sandbox strict protect-owned merge-sync userpriv usersync fixlafiles network-sandbox binpkg-docompress binpkg-dostrip ebuild-locks unmerge-logs sign config-protect-if-modified assume-digests unknown-features-warn parallel-fetch strict-keepdir unmerge-orphans"
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-03-29 08:32:48 UTC
Old version removed.  Please reopen if it still happens.
Comment 3 Christopher Head 2020-03-30 05:13:09 UTC
Still happens with latest stable.

Gentoo setuptools includes these files which venv setuptools does not (both includes them in the tarball and also lists them in SOURCES.txt):
.gitignore
.gitlab-ci.yml
.pylintrc
LICENSE
src/pkgname.egg-info/zip-safe
tests/*

Meanwhile, although both versions include src/pkgname.egg-info/zip-safe in the tarball, venv setuptools also lists that file in SOURCES.txt while Gentoo setuptools does not.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-03-30 05:35:40 UTC
That's a curious claim, given that we certainly do not apply any patches to setuptools that could affect this.
Comment 5 Christopher Head 2020-03-30 05:53:50 UTC
I’ve tracked down the problem. It’s the mere existence in my installed package set of dev-python/setuptools_scm (pulled in as a dependency of a few other packages), which apparently modifies the behaviour of setuptools even when my package doesn’t ask for it in any way.

Not sure if this should be:
* a bug on setuptools, having its behaviour changed even when setup.py doesn’t ask for it,
* a bug on setuptools_scm, for the same thing,
* or not a bug at all?
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-03-30 05:58:11 UTC
This is how it works, and you can't make it work otherwise without breaking all packages using setuptools_scm.