Debian Codegraph @

docs/dev/repository.rst

raw
1 .. include:: ../header.rst
2
3 =====================================
4 The Docutils_ Version Repository
5 =====================================
6
7 :Author: Lea Wiemann, Docutils developers
8 :Contact: [email protected]
9 :Revision: $Revision: 10020 $
10 :Date: $Date: 2025-03-07 23:58:36 +0100 (Fr, 07. Mär 2025) $
11 :Copyright: This document has been placed in the public domain.
12
13 .. _Docutils: https://docutils.sourceforge.io/
14
15 .. admonition:: Quick Instructions
16
17 To get a checkout of the Docutils source tree (with the
18 sandboxes) with SVN_, type ::
19
20 svn checkout https://svn.code.sf.net/p/docutils/code/trunk docutils-code
21
22 Users of Git_ can clone a mirror of the docutils repository with ::
23
24 git clone git://repo.or.cz/docutils.git
25
26 If you are going to commit changes to the repository, please read
27 the **whole document**, especially the section "`Information for
28 Developers`_"!
29
30 Docutils uses a Subversion_ (SVN) repository located at
31 ``docutils.svn.sourceforge.net``.
32
33 While Unix and Mac OS X users will probably prefer the standard
34 Subversion command line interface, Windows user may want to try
35 TortoiseSVN_, a convenient explorer extension. The instructions apply
36 analogously.
37
38 There is a Git_ mirror at http://repo.or.cz/docutils.git providing
39 `web access`_ and the base for `creating a local Git clone`_.
40 [#github-mirrors]_
41
42 For the project policy on repository use (check-in requirements,
43 branching, etc.), please see the `Docutils Project Policies`__.
44
45 __ policies.html#subversion-repository
46
47 .. _SVN:
48 .. _Subversion: https://subversion.apache.org/
49 .. _TortoiseSVN: https://tortoisesvn.net/
50 .. _SourceForge.net: https://sourceforge.net/
51 .. _Git: http://git-scm.com/
52
53 .. contents::
54
55
56 Accessing the Repository
57 ========================
58
59 Web Access
60 ----------
61
62 The repository can be browsed and examined via the web at
63 https://sourceforge.net/p/docutils/code.
64
65 Alternatively, use the web interface at http://repo.or.cz/docutils.git.
66 [#github-mirrors]_
67
68 .. [#github-mirrors] There are also 3rd-party mirrors and forks at
69 GitHub, some of them orphaned. At the time of this writing (2021-11-03),
70 https://github.com/live-clones/docutils/tree/master/docutils
71 provides an hourly updated clone.
72
73 Repository Access Methods
74 -------------------------
75
76 To get a checkout, first determine the root of the repository depending
77 on your preferred protocol:
78
79 anonymous access: (read only)
80 Subversion_: ``https://svn.code.sf.net/p/docutils/code``
81
82 Git_: ``git://repo.or.cz/docutils.git``
83
84 `developer access`_: (read and write)
85 ``svn+ssh://<USERNAME>@svn.code.sf.net/p/docutils/code``
86
87 Checking Out the Repository
88 ---------------------------
89
90 .. _creating a local Git clone:
91
92 Git_ users can clone a mirror of the docutils repository with ::
93
94 git clone git://repo.or.cz/docutils.git
95
96 and proceed according to the `Git documentation`_.
97 Developer access (read and write) is possible with `git svn`_.
98
99 .. _Git documentation: https://git.wiki.kernel.org/index.php/GitDocumentation
100 .. _git svn: https://git.wiki.kernel.org/index.php/Git-svn
101
102 Subversion_ users can use the following commands
103 (substitute your preferred repository root for ROOT):
104
105 * To check out only the current main source tree of Docutils, type ::
106
107 svn checkout ROOT/trunk/docutils
108
109 * To check out everything (main tree, sandboxes, web site, and parallel
110 projects), type ::
111
112 svn checkout ROOT/trunk docutils
113
114 This will create a working copy of the whole trunk in a new directory
115 called ``docutils``.
116
117 Note that you probably do *not* want to check out the ROOT itself
118 (without "/trunk"), because then you'd end up fetching the whole
119 Docutils tree for every branch and tag over and over again.
120
121 To update your working copy later on, ``cd`` into the working copy and
122 type ::
123
124 svn update
125
126 Switching the Repository Root
127 -----------------------------
128
129 If you changed your mind and want to use a different repository root,
130 ``cd`` into your working copy and type::
131
132 svn switch --relocate OLDROOT NEWROOT
133
134
135 Editable installs
136 =================
137
138 There are several ways to ensure that edits to the Docutils code are
139 picked up by Python.
140
141 We'll assume that the Docutils "trunk" is checked out under the
142 ``~/projects/`` directory.
143
144 1. Do an `editable install`__ with pip_::
145
146 python3 -m pip install -e ~/projects/docutils/docutils
147
148 __ https://pip.pypa.io/en/stable/topics/local-project-installs/
149 #editable-installs
150
151 .. _manual install:
152
153 2. Install "manually".
154
155 Ensure that the "docutils" package is in the module search path
156 (``sys.path``) by one of the following actions:
157
158 a) Set the ``PYTHONPATH`` environment variable.
159
160 For the bash shell, add this to your ``~/.profile``::
161
162 PYTHONPATH=$HOME/projects/docutils/docutils
163 export PYTHONPATH
164
165 The first line points to the directory containing the ``docutils``
166 package, the second line exports the environment variable.
167
168 b) Create a symlink to the docutils package directory somewhere in the
169 ``sys.path``, e.g., ::
170
171 ln -s ~/projects/docutils/docutils \
172 /usr/local/lib/python3.9/dist-packages/
173
174 c) Use a `path configuration file`__.
175
176 __ https://docs.python.org/library/site.html
177
178 Optionally, add some or all `front-end tools`_ to the binary search
179 path, e.g.:
180
181 a) add the ``tools`` directory to the ``PATH`` variable::
182
183 PATH=$PATH:$HOME/projects/docutils/docutils/tools
184 export PATH
185
186 or
187
188 b) link idividual front-end tools to a suitable place in the binary
189 path::
190
191 ln -s ~/projects/docutils/docutils/tools/docutils-cli.py \
192 /usr/local/bin/docutils
193
194 3. Do a regular install. Repeat after any change.
195
196 .. CAUTION::
197
198 This method is **not** recommended for day-to-day development!
199
200 If you ever forget to reinstall the "docutils" package, Python
201 won't see your latest changes. Confusion inevitably ensues.
202
203 Tip:
204 A useful addition to the ``docutils`` top-level directory in
205 *SVN branches* and *alternate copies* of the code is a ``set-PATHS``
206 shell script containing the following lines::
207
208 # source this file
209 export PYTHONPATH=$PWD:$PYTHONPATH
210 export PATH=$PWD/tools:$PATH
211
212 Open a shell for this branch, ``cd`` to the ``docutils`` top-level
213 directory, and "source" this file. For example, using the bash
214 shell::
215
216 $ cd some-branch/docutils
217 $ . set-PATHS
218
219 .. _pip: https://pypi.org/project/pip/
220 .. _setuptools: https://pypi.org/project/setuptools/
221 .. _front-end tools: ../user/tools.html
222
223
224 .. _developer access:
225
226 Information for Developers
227 ==========================
228
229 If you would like to have write access to the repository, register
230 with SourceForge.net_ and send your SourceForge.net
231 user names to [email protected].
232 (Note that there may be a delay of several hours until you can commit
233 changes to the repository.)
234
235 Sourceforge SVN access is documented `here`__
236
237 __ https://sourceforge.net/p/forge/documentation/svn/
238
239
240 Ensure any changes comply with the `Docutils Project Policies`_
241 before `checking in`_,
242
243 .. _Docutils Project Policies: policies.html
244 .. _checking in: policies.html#check-ins
245
246
247 Setting Up Your Subversion Client For Development
248 -------------------------------------------------
249
250 Before committing changes to the repository, please ensure that the
251 following lines are contained (and uncommented) in your local
252 ~/.subversion/config file, so that new files are added with the
253 correct properties set::
254
255 [miscellany]
256 # For your convenience:
257 global-ignores = ... *.pyc ...
258 # For correct properties:
259 enable-auto-props = yes
260
261 [auto-props]
262 *.py = svn:eol-style=native;svn:keywords=Author Date Id Revision
263 *.rst = svn:eol-style=native;svn:keywords=Author Date Id Revision
264 *.txt = svn:eol-style=native;svn:keywords=Author Date Id Revision
265 *.html = svn:eol-style=native;svn:keywords=Author Date Id Revision
266 *.xml = svn:eol-style=native;svn:keywords=Author Date Id Revision
267 *.tex = svn:eol-style=native;svn:keywords=Author Date Id Revision
268 *.css = svn:eol-style=native;svn:keywords=Author Date Id Revision
269 *.patch = svn:eol-style=native
270 *.sh = svn:eol-style=native;svn:executable;svn:keywords=Author Date Id Revision
271 *.png = svn:mime-type=image/png
272 *.jpg = svn:mime-type=image/jpeg
273 *.gif = svn:mime-type=image/gif
274
275
276 Repository Layout
277 =================
278
279 The following tree shows the repository layout::
280
281 docutils/
282 |-- branches/
283 | |-- branch1/
284 | | |-- docutils/
285 | | |-- sandbox/
286 | | `-- web/
287 | `-- branch2/
288 | |-- docutils/
289 | |-- sandbox/
290 | `-- web/
291 |-- tags/
292 | |-- tag1/
293 | | |-- docutils/
294 | | |-- sandbox/
295 | | `-- web/
296 | `-- tag2/
297 | |-- docutils/
298 | |-- sandbox/
299 | `-- web/
300 `-- trunk/
301 |-- docutils/
302 |-- sandbox/
303 `-- web/
304
305 The main source tree lives at ``docutils/trunk/docutils/``, next to
306 the sandboxes (``docutils/trunk/sandbox/``) and the web site files
307 (``docutils/trunk/web/``).
308
309 ``docutils/branches/`` and ``docutils/tags/`` contain (shallow) copies
310 of either the whole trunk or only the main source tree
311 (``docutils/trunk/docutils``).