@@ -73,10 +73,10 @@ a few important reasons to provide a static archive file instead:
7373 supported than e.g. using a git clone. This can help users with poor
7474 Internet connectivity.
7575
76- - Downstreams often ** use checksums to verify the authenticity ** of source files
76+ - Downstreams often use hashes to verify the authenticity of source files
7777 on subsequent builds, which require that they remain bitwise identical over
7878 time. For example, automatically generated git archives do not guarantee
79- that .
79+ this, as the compressed data may change if gzip is upgraded on the server .
8080
8181- Archive files can be mirrored, reducing both upstream and downstream
8282 bandwidth use. The actual builds can afterwards be performed in firewalled
@@ -132,8 +132,8 @@ is discouraged for a number of reasons:
132132 unavailable, making the build no longer possible. This is especially
133133 problematic when someone needs to build an old package version.
134134
135- - Accessing remote servers poses a ** privacy ** issue and a potential
136- ** security ** issue, as it exposes information about the system building
135+ - Accessing remote servers poses a privacy issue and a potential
136+ security issue, as it exposes information about the system building
137137 the package.
138138
139139- The user may be using a service with a limited data plan, in which
@@ -153,8 +153,8 @@ When such a switch is used, the build process should fail if some
153153of the required files are missing, rather than try to fetch them automatically.
154154This could be done e.g. by checking whether a ``NO_NETWORK `` environment
155155variable is set to a non-empty value. Please also remember that if you are
156- fetching remote resources, you must ** verify their authenticity **, e.g. against
157- a checksum , to protect against the file being substituted by a malicious party.
156+ fetching remote resources, you must *verify their authenticity * (usually against
157+ a hash) , to protect against the file being substituted by a malicious party.
158158
159159Since downstreams frequently also run tests and build documentation, the above
160160should ideally extend to these processes as well.
@@ -165,11 +165,9 @@ should ideally extend to these processes as well.
165165Support building against system dependencies
166166--------------------------------------------
167167
168-
169168Why?
170169~~~~
171170
172-
173171Some Python projects have non-Python dependencies, such as libraries written
174172in C or C++. Trying to use the system versions of these dependencies
175173in upstream packaging may cause a number of problems for end users:
@@ -237,7 +235,6 @@ In particular:
237235How?
238236~~~~
239237
240-
241238A good compromise between the needs of both parties is to provide a switch
242239between using vendored and system dependencies. Ideally, if the package has
243240multiple vendored dependencies, it should provide both individual switches
@@ -266,11 +263,9 @@ are better equipped to handle.
266263Support downstream testing
267264--------------------------
268265
269-
270266Why?
271267~~~~
272268
273-
274269A variety of downstream projects run some degree of testing on the packaged
275270Python projects. Depending on the particular case, this can range from minimal
276271smoke testing to comprehensive runs of the complete test suite. There can
@@ -287,7 +282,7 @@ be various reasons for doing this, for example:
287282 the ones present during upstream release testing.
288283
289284- Testing the package in an environment closely resembling the production
290- setup. This can detect issues caused by nontrivial interactions between
285+ setup. This can detect issues caused by non-trivial interactions between
291286 different installed packages, including packages that are not dependencies
292287 of your package, but nevertheless can cause issues.
293288
@@ -297,15 +292,14 @@ be various reasons for doing this, for example:
297292Admittedly, sometimes downstream testing may yield false positives or bug
298293reports about scenarios the upstream project is not interested in supporting.
299294However, perhaps even more often it does provide early notice of problems,
300- or find nontrivial bugs that would otherwise cause issues for your users
301- in production. And believe me , the majority of ** downstream packagers are doing
302- their best to double-check their results, and help you triage and fix the bugs
303- that they report ** .
295+ or find non-trivial bugs that would otherwise cause issues for the upstream
296+ project's users. While mistakes do happen , the majority of downstream packagers
297+ are doing their best to double-check their results, and help upstream
298+ maintainers triage and fix the bugs that they reported .
304299
305300How?
306301~~~~
307302
308-
309303There are a number of things that upstream projects can do to help downstream
310304repackagers test their packages efficiently and effectively, including some of the suggestions
311305already mentioned above. These are typically improvements that make the test suite more
@@ -367,6 +361,10 @@ Some specific suggestions are:
367361 the ability to conveniently deselect tests, rerun flaky tests
368362 (via pytest-rerunfailures _), add a timeout to prevent tests from hanging
369363 (via pytest-timeout _) or run tests in parallel (via pytest-xdist _).
364+ Note that test suites don't need to be *written * with ``pytest `` to be
365+ *executed * with ``pytest ``: ``pytest `` is able to find and execute almost
366+ all test cases that are compatible with the standard library's ``unittest ``
367+ test discovery.
370368
371369
372370.. _responses : https://pypi.org/project/responses/
0 commit comments