You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After cloning a repository and connecting to the resulting working tree confirm that you have ``git-lfs`` and then issue ``git lfs install`` to install configuration and hooks and then ``git lfs track`` to designate targets for git-lfs.
7
+
After cloning a repository and connecting to the resulting working tree confirm
8
+
that you have ``git-lfs`` and then issue ``git lfs install`` to install
9
+
configuration and hooks and then ``git lfs track`` to designate targets for git-lfs.
8
10
9
11
.. code-block:: bash
10
12
@@ -26,12 +28,17 @@ After cloning a repository and connecting to the resulting working tree confirm
`Git-lfs <https://git-lfs.com/>`_ replaces large files such as datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server.
30
-
This can be very useful for projects that have large data files that change infrequently. It does require a remote that supports git-lfs and so if you are unsure about
31
-
whether you want to use git-lfs you probably do not want to use it until you understand it better.
31
+
`Git-lfs <https://git-lfs.com/>`_ replaces large files such as datasets, and
32
+
graphics with text pointers inside Git, while storing the file contents on a remote server.
33
+
This can be very useful for projects that have large data files that change
34
+
infrequently.
35
+
It does require a remote that supports git-lfs and so if you are unsure about
36
+
whether you want to use git-lfs you probably do not want to use it until you
37
+
understand it better.
32
38
33
39
This template provides a starting point for using git-lfs with a project.
34
-
Note that you need to install the program ``git-lfs`` separately as that is not easily done as part of the installation. See :ref:`get-git-lfs-label`.
40
+
Note that you need to install the program ``git-lfs`` separately as that is not
41
+
easily done as part of the installation. See :ref:`get-git-lfs-label`.
@@ -73,8 +80,10 @@ and several other git servers do support git-lfs. If you use another remote you
73
80
Designate files for git-lfs tracking
74
81
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75
82
You will also want add paths to ``.gitattributes`` that designate the files git-lfs will manage for git.
76
-
While you can edit ``.gitattributes`` directly there is a command that will make the needed changes and create the file if necessary.
77
-
For example, if you want to specify that ``FITS`` files are handled by git-lfs then you might use these commands
83
+
While you can edit ``.gitattributes`` directly there is a command that will make
84
+
the needed changes and create the file if necessary.
85
+
For example, if you want to specify that ``FITS`` files are handled by git-lfs
86
+
then you might use these commands
78
87
79
88
.. code-block:: bash
80
89
@@ -94,13 +103,18 @@ in the lsst developer documentation and adapt its recommendations to your projec
94
103
Uninstall git-lfs from the repository
95
104
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96
105
97
-
If you want to stop using git-lfs going forward then you can uninstall it. You should use the same options used on installation, in particular if you specified the ``--local`` option you should also specify it here. Probably it is safer to always include the ``--local`` option so you restrict impact to the current repository.
106
+
If you want to stop using git-lfs going forward then you can uninstall it.
107
+
You should use the same options used on installation, in particular if you
108
+
specified the ``--local`` option you should also specify it here.
109
+
Probably it is safer to always include the ``--local`` option so you restrict
110
+
impact to the current repository.
98
111
99
112
.. code-block:: bash
100
113
101
114
git lfs uninstall --local
102
115
103
-
Any files modified after uninstalling git-lfs will become part of the regular git repository but the git-lfs artifacts will remain.
116
+
Any files modified after uninstalling git-lfs will become part of the regular
117
+
git repository but the git-lfs artifacts will remain.
104
118
105
119
Note that we recommend against uninstalling git-lfs as it causes confusion.
106
120
@@ -110,7 +124,8 @@ You can see what files are controlled by git-lfs using the ``git lfs ls-files``
110
124
111
125
git lfs ls-files
112
126
113
-
Then if you want to copy them to the regular git repository you can change their modification dates using ``touch`` and commit the changes.
127
+
Then if you want to copy them to the regular git repository you can change their
128
+
modification dates using ``touch`` and commit the changes.
Linting is a form of static program checking, meaning that it analyzes code without running it.
8
-
9
-
A linter checks code for code errors, violations of some agreed-upon coding standards, or gives its opinion on code smells. A "code smell" is when something isn't exactly **wrong**, but could be an indicator that your code is inefficient or could be refactored to be cleaner.
10
-
11
-
When code is reliably run through a linter, then code reviewers can assume that the code they're looking at adheres to that agreed-upon coding standard.
12
-
A code reviewer won't be distracted by improper spacing, and can focus their reviewing effort on the meat of the code.
13
-
14
-
There are two main linters suggested by this template: pylint and black. While they have a lot of the same opinions, we recommend picking a single standard for your project and sticking to it. If some folks use one linter, this may cause undue churn in your source files as each developer creates some formatting changes each time they touch a file (and then another developer undoes them the next time they touch the same file).
7
+
Linting is a form of static program checking, meaning that it analyzes code
8
+
without running it.
9
+
10
+
A linter checks code for code errors, violations of some agreed-upon coding
11
+
standards, or gives its opinion on code smells. A "code smell" is when something
12
+
isn't exactly **wrong**, but could be an indicator that your code is inefficient
13
+
or could be refactored to be cleaner.
14
+
15
+
When code is reliably run through a linter, then code reviewers can assume that
16
+
the code they're looking at adheres to that agreed-upon coding standard.
17
+
A code reviewer won't be distracted by improper spacing, and can focus their
18
+
reviewing effort on the meat of the code.
19
+
20
+
There are two main linters suggested by this template: pylint and black. While
21
+
they have a lot of the same opinions, we recommend picking a single standard for
22
+
your project and sticking to it.
23
+
If some folks use one linter, this may cause undue churn in your source files as
24
+
each developer creates some formatting changes each time they touch a file (and
25
+
then another developer undoes them the next time they touch the same file).
Copier will ask you questions for how to set up the project. These questions will be used to fill in aspects of the project's configuration, including both metadata and parameters. Below we provide some high-level overview of the questions:
15
+
Copier will ask you questions for how to set up the project. These questions
16
+
will be used to fill in aspects of the project's configuration, including both
17
+
metadata and parameters. Below we provide some high-level overview of the
18
+
questions:
15
19
16
20
.. list-table::
17
21
:header-rows: 1
@@ -44,27 +48,37 @@ Copier will ask you questions for how to set up the project. These questions wil
44
48
- Support for large files for use in git. This option is primarily informational and no answer locks you in to using (or not using) git-lfs. Importantly, selecting this option does not install git-lfs for your project (see :doc:`Git_Large_File_Support <../practices/git-lfs>`).
45
49
46
50
47
-
While these choices will provide the initial structure for your project, most can be changed later. See Copier's `documentation for changing answers to the question <https://copier.readthedocs.io/en/stable/updating/>`_.
51
+
While these choices will provide the initial structure for your project, most
52
+
can be changed later.
53
+
See Copier's `documentation for changing answers to the question <https://copier.readthedocs.io/en/stable/updating/>`_.
48
54
49
-
After providing answers to the prompts, Copier will hydrate a project template and save it in the specified location. Additionally Copier will run ``git init`` in the new project directory to initialize it as a local repository.
55
+
After providing answers to the prompts, Copier will hydrate a project template
56
+
and save it in the specified location. Additionally Copier will run
57
+
``git init`` in the new project directory to initialize it as a local repository.
50
58
51
59
Create a new environment
52
60
---------------------------
53
61
54
62
If you are using `virtual environments <https://packaging.python.org/en/latest/glossary/#term-Virtual-Environment>`_
55
-
create a new environment with your choice of environment tools (virtualenv, conda, etc.) and activate it.
56
-
This step is optional, but we recommend using virtual environments to better manage different project's dependencies.
57
-
See Python's `description of virtual environments <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/>`_ for more details.
63
+
create a new environment with your choice of environment tools (virtualenv,
64
+
conda, etc.) and activate it.
65
+
This step is optional, but we recommend using virtual environments to better
66
+
manage different project's dependencies.
67
+
See Python's `description of virtual environments <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/>`_
68
+
for more details.
58
69
59
70
.. tip::
60
-
Projects using Python notebooks will need to have ``pandoc`` installed to convert notebooks to html locally.
61
-
Pandoc is `available on conda-forge <https://github.com/conda-forge/pandoc-feedstock>`_, so conda can be a convenient way to keep these dependencies grouped together.
71
+
Projects using Python notebooks will need to have ``pandoc`` installed to
72
+
convert notebooks to html locally.
73
+
Pandoc is `available on conda-forge <https://github.com/conda-forge/pandoc-feedstock>`_,
74
+
so conda can be a convenient way to keep these dependencies grouped together.
At this point, your new project is hydrated and ready for you to start coding. But there's a lot more that this template has to offer. Keep reading to find out more about built in pre-commit hooks, GitHub CI, automatic documentation, and more.
102
+
At this point, your new project is hydrated and ready for you to start coding.
103
+
But there's a lot more that this template has to offer.
104
+
Keep reading to find out more about built in pre-commit hooks, GitHub CI,
Notice that when you create a PR in GitHub, a set of tests for Continuous Integration starts up to verify that the project can build successfully and that all the unit tests pass. Neato!
130
+
Notice that when you create a PR in GitHub, a set of tests for Continuous
131
+
Integration starts up to verify that the project can build successfully and
0 commit comments