annotate tests/test-check-sdist.t @ 6872:1ce9c2252965

tests: compare tarball with source directory in test-check-sdist.t We only care about test-repo case because that's how we generate sdist files (and even then we use `hg archive` first). Creating hg-evolve tarballs from sources obtained by any other method is not common and is a different can of worms.
author Anton Shestakov <av6@dwimlabs.net>
date Sun, 06 Oct 2024 19:48:18 +0400
parents f1eefaa0ad28
children 361dcfcb3f08
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5772
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
1 Enable obsolescence to avoid the warning issue when obsmarkers are found
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
2
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
3 $ cat << EOF >> "$HGRCPATH"
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
4 > [experimental]
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
5 > evolution = all
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
6 > EOF
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
7
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
8 $ cd "$TESTDIR"/..
5799
fe9f9e528a42 tests: make test-check-sdist.t less flaky by first archiving the repo
Anton Shestakov <av6@dwimlabs.net>
parents: 5784
diff changeset
9
fe9f9e528a42 tests: make test-check-sdist.t less flaky by first archiving the repo
Anton Shestakov <av6@dwimlabs.net>
parents: 5784
diff changeset
10 Archiving to a separate location to avoid hardlink mess when the repo is shared
fe9f9e528a42 tests: make test-check-sdist.t less flaky by first archiving the repo
Anton Shestakov <av6@dwimlabs.net>
parents: 5784
diff changeset
11
fe9f9e528a42 tests: make test-check-sdist.t less flaky by first archiving the repo
Anton Shestakov <av6@dwimlabs.net>
parents: 5784
diff changeset
12 #if test-repo
fe9f9e528a42 tests: make test-check-sdist.t less flaky by first archiving the repo
Anton Shestakov <av6@dwimlabs.net>
parents: 5784
diff changeset
13
6852
374f1c5995dd tests: use testrepohg in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6558
diff changeset
14 $ . "$RUNTESTDIR/helpers-testrepo.sh"
374f1c5995dd tests: use testrepohg in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6558
diff changeset
15 $ testrepohg archive "$TESTTMP"/hg-evolve
5799
fe9f9e528a42 tests: make test-check-sdist.t less flaky by first archiving the repo
Anton Shestakov <av6@dwimlabs.net>
parents: 5784
diff changeset
16 $ cd "$TESTTMP"/hg-evolve
fe9f9e528a42 tests: make test-check-sdist.t less flaky by first archiving the repo
Anton Shestakov <av6@dwimlabs.net>
parents: 5784
diff changeset
17
fe9f9e528a42 tests: make test-check-sdist.t less flaky by first archiving the repo
Anton Shestakov <av6@dwimlabs.net>
parents: 5784
diff changeset
18 #endif
fe9f9e528a42 tests: make test-check-sdist.t less flaky by first archiving the repo
Anton Shestakov <av6@dwimlabs.net>
parents: 5784
diff changeset
19
6860
416adeb7d418 tests: check metadata and long description using `setup.py check`
Anton Shestakov <av6@dwimlabs.net>
parents: 6859
diff changeset
20 $ "$PYTHON" setup.py check --metadata --restructuredtext
416adeb7d418 tests: check metadata and long description using `setup.py check`
Anton Shestakov <av6@dwimlabs.net>
parents: 6859
diff changeset
21
5772
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
22 $ "$PYTHON" setup.py sdist --dist-dir "$TESTTMP"/dist > /dev/null
6859
e57c9da94b25 tests: make UserWarning about python_requires in test-check-sdist.t optional
Anton Shestakov <av6@dwimlabs.net>
parents: 6858
diff changeset
23 */dist.py:*: UserWarning: Unknown distribution option: 'python_requires' (glob) (?)
e57c9da94b25 tests: make UserWarning about python_requires in test-check-sdist.t optional
Anton Shestakov <av6@dwimlabs.net>
parents: 6858
diff changeset
24 warnings.warn(msg) (?)
5772
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
25 warning: no previously-included files found matching 'docs/tutorial/.netlify'
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
26 warning: no previously-included files found matching '.gitlab-ci.yml'
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
27 warning: no previously-included files found matching '.hg-format-source'
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
28 warning: no previously-included files found matching 'Makefile'
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
29 no previously-included directories found matching 'contrib'
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
30 no previously-included directories found matching 'debian'
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
31 no previously-included directories found matching '.gitlab'
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
32 $ cd "$TESTTMP"/dist
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
33
6858
37844623df8c tests: accommodate both "hg-evolve" and "hg_evolve" in tarballs
Anton Shestakov <av6@dwimlabs.net>
parents: 6857
diff changeset
34 $ find hg?evolve-*.tar.gz -size +800000c
37844623df8c tests: accommodate both "hg-evolve" and "hg_evolve" in tarballs
Anton Shestakov <av6@dwimlabs.net>
parents: 6857
diff changeset
35 hg?evolve-*.tar.gz (glob)
5772
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
36
6871
f1eefaa0ad28 tests: strip trailing slash and skip the first line in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6870
diff changeset
37 $ tar -tzf hg?evolve-*.tar.gz | sed 's|^hg.evolve-[^/]*/||;s|/$||;/^$/d' | sort > ../files
6845
4836e75f0a03 tests: don't put file lists inside dist/ directory
Anton Shestakov <av6@dwimlabs.net>
parents: 6844
diff changeset
38 $ grep -E '^tests/test-.*\.(t|py)$' ../files > ../test-files
4836e75f0a03 tests: don't put file lists inside dist/ directory
Anton Shestakov <av6@dwimlabs.net>
parents: 6844
diff changeset
39 $ grep -E -v '^tests/test-.*\.(t|py)$' ../files > ../other-files
4836e75f0a03 tests: don't put file lists inside dist/ directory
Anton Shestakov <av6@dwimlabs.net>
parents: 6844
diff changeset
40 $ wc -l ../other-files
6848
e823d9117a68 tests: further relax the number of files check in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6846
diff changeset
41 ??? ../other-files (glob)
6845
4836e75f0a03 tests: don't put file lists inside dist/ directory
Anton Shestakov <av6@dwimlabs.net>
parents: 6844
diff changeset
42 $ wc -l ../test-files
4836e75f0a03 tests: don't put file lists inside dist/ directory
Anton Shestakov <av6@dwimlabs.net>
parents: 6844
diff changeset
43 ??? ../test-files (glob)
4836e75f0a03 tests: don't put file lists inside dist/ directory
Anton Shestakov <av6@dwimlabs.net>
parents: 6844
diff changeset
44 $ grep -F debian ../files
5772
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
45 tests/test-check-debian.t
6845
4836e75f0a03 tests: don't put file lists inside dist/ directory
Anton Shestakov <av6@dwimlabs.net>
parents: 6844
diff changeset
46 $ grep -F __init__.py ../files
5772
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
47 hgext3rd/__init__.py
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
48 hgext3rd/evolve/__init__.py
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
49 hgext3rd/evolve/thirdparty/__init__.py
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
50 hgext3rd/topic/__init__.py
6845
4836e75f0a03 tests: don't put file lists inside dist/ directory
Anton Shestakov <av6@dwimlabs.net>
parents: 6844
diff changeset
51 $ grep -F common.sh ../files
5772
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
52 docs/tutorial/testlib/common.sh
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
53 tests/testlib/common.sh
6845
4836e75f0a03 tests: don't put file lists inside dist/ directory
Anton Shestakov <av6@dwimlabs.net>
parents: 6844
diff changeset
54 $ grep -F README ../files
5772
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
55 README.rst
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
56 docs/README
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
57 docs/tutorial/README.rst
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
58 hgext3rd/topic/README
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
59
6845
4836e75f0a03 tests: don't put file lists inside dist/ directory
Anton Shestakov <av6@dwimlabs.net>
parents: 6844
diff changeset
60 $ grep -E '(gitlab|contrib|hack|format-source)' ../files
5772
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
61 [1]
6845
4836e75f0a03 tests: don't put file lists inside dist/ directory
Anton Shestakov <av6@dwimlabs.net>
parents: 6844
diff changeset
62 $ grep -F netlify ../files
5772
da01b9062cfb tests: add test-check-sdist.t to check setup.py sdist results
Anton Shestakov <av6@dwimlabs.net>
parents:
diff changeset
63 [1]
6849
9638dd0fb4ea tests: add `twine check` to test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6848
diff changeset
64
6872
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
65 #if test-repo
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
66 $ ( cd "$TESTTMP"/hg-evolve && find . ) | sed -e 's|^\./||;/^\.$/d' | sort > ../src-files
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
67
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
68 extra files/directories in the tarball
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
69 $ comm -23 ../files ../src-files
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
70 PKG-INFO
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
71
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
72 source files/directories excluded from the tarball
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
73 $ comm -13 ../files ../src-files
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
74 .gitlab
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
75 .gitlab-ci.yml
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
76 .gitlab/issue_templates
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
77 .gitlab/issue_templates/new-version.md
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
78 .hg-format-source
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
79 .hg_archival.txt
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
80 .hgignore
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
81 .hgtags
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
82 Makefile
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
83 contrib
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
84 contrib/docker
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
85 contrib/docker/pytype
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
86 contrib/docker/pytype/Dockerfile
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
87 contrib/docker/pytype/README.rst
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
88 contrib/docker/pytype/entrypoint.sh
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
89 contrib/hammerclient.py
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
90 contrib/merge-test-compat.sh
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
91 contrib/nopushpublish.py
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
92 debian
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
93 debian/changelog
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
94 debian/compat
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
95 debian/control
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
96 debian/copyright
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
97 debian/docs
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
98 debian/rules
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
99 debian/source
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
100 debian/source/format
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
101 debian/source/options
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
102 debian/test-blacklist
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
103 docs/tutorial/.netlify
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
104 hgext3rd/evolve/hack
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
105 hgext3rd/evolve/hack/__init__.py
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
106 hgext3rd/evolve/hack/drophack.py
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
107 tests/test-drop.t
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
108 #endif
1ce9c2252965 tests: compare tarball with source directory in test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6871
diff changeset
109
6849
9638dd0fb4ea tests: add `twine check` to test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6848
diff changeset
110 #if twine
9638dd0fb4ea tests: add `twine check` to test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6848
diff changeset
111 $ twine --no-color check *
9638dd0fb4ea tests: add `twine check` to test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6848
diff changeset
112 Checking hg?evolve-*.tar.gz: PASSED (glob)
9638dd0fb4ea tests: add `twine check` to test-check-sdist.t
Anton Shestakov <av6@dwimlabs.net>
parents: 6848
diff changeset
113 #endif