Debian Codegraph @

test/expensive_benchmarks/docutils_data/docs/dev/repository.txt

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