File: dev.rst

package info (click to toggle)
python-bleach 6.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,348 kB
  • sloc: python: 14,628; sh: 60; makefile: 51
file content (122 lines) | stat: -rw-r--r-- 2,694 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
==================
Bleach development
==================

Install for development
=======================

To install Bleach to make changes to it:

1. Clone the repo from GitHub::

       $ git clone git://github.com/mozilla/bleach.git

2. Create and activate a virtual environment.

3. Install Bleach and developer requirements into the virtual environment::

       $ pip install -r requirements-dev.txt


Code of conduct
===============

This project has a `code of conduct
<https://github.com/mozilla/bleach/blob/main/CODE_OF_CONDUCT.md>`_.


.. include:: ../CONTRIBUTING.rst


Docs
====

Docs are in ``docs/``. We use Sphinx. Docs are pushed to ReadTheDocs
via a GitHub webhook.


Testing
=======

Run::

    $ tox

That'll run Bleach tests in all the supported Python environments. Note that
you need the necessary Python binaries for them all to be tested.

Tests are run as GitHub actions for test and pull request events.


Release process
===============

1. Checkout main tip.

2. Check to make sure ``setup.py`` is correct and match requirements-wise.

3. Update version numbers in ``bleach/__init__.py``.

   1. Set ``__version__`` to something like ``2.0.0``. Use
      semver. Bump the minor version if a vendored library was
      unvendored or updated.
   2. Set ``__releasedate__`` to something like ``20120731``.

4. Update ``CONTRIBUTORS``, ``CHANGES``, ``MANIFEST.in`` and
   ``SECURITY.md`` as necessary.

5. Verify correctness.

   1. Run linting, tests, and everything else with tox::

         $ tox

   2. Build the docs::

         $ cd docs
         $ make html

   3. Run the doctests::

         $ cd docs/
         $ make doctest

   4. Verify the local vendored files (the second invocation should **not**
      exit with ``/tmp/vendor-test exists. Please remove.`` and the exit
      code should be zero)::

         $ make vendorverify

   5. Run any additional tests to verify everything else works

6. Commit the changes.

7. Push the changes to GitHub. This will cause Github Actions to run the tests.

8. After CI passes, create a signed tag for the release::

      $ git tag -s v0.4.0

   Copy the details from ``CHANGES`` into the tag comment.

9. Generate distribution files::

      $ python -m build

10. Sanity check the release contents and sizes::

       $ ls -lh dist/* # file sizes should be similar
       $ tar tvzf dist/bleach-${VERSION}.tar.gz
       $ unzip -v dist/bleach-${VERSION}-py2.py3-none-any.whl

11. Using a PyPI API token, upload dist files to PyPI::

       $ twine upload -r [REPO] dist/*

12. Push the new tag::

       $ git push --tags [REMOTE] main

    That will push the release to PyPI.

13. Blog posts, twitter, etc.