@@ -29,7 +29,7 @@ and objects from other Python files (modules). Now we will take it a step furthe
2929
3030- Collect related functions into modules (files).
3131- Collect related modules into packages (we will show how).
32- - Add a ``LICENSE `` file to your code
32+ - Add a ``LICENSE `` file to your code from ` choosealicense.com < https://choosealicense.com >`__
3333 (see `Software Licensing and Open source explained with cakes <https://github.com/coderefinery/social-coding/blob/main/licensing-and-cakes.md >`__).
3434- Write a ``README.md `` file describing what the code does and how to use it.
3535- It is also recommended to `document your package <https://coderefinery.github.io/documentation/ >`__.
@@ -116,6 +116,22 @@ Now we have all the building blocks to test a local pip install. This is a good
116116test before trying to upload a package to PyPI or test-PyPI
117117(see :ref: `pypi `)
118118
119+ .. note ::
120+
121+ Sometime you need to rely on unreleased, development versions as
122+ dependencies and this is also possible. For example, to use the
123+ latest ``xarray `` you could add::
124+
125+ dependencies = [
126+ "scipy",
127+ "xarray @ https://github.com/pydata/xarray/archive/main.zip"
128+ ]
129+
130+ .. seealso ::
131+ - `pip requirement specifiers <https://pip.pypa.io/en/stable/reference/requirement-specifiers/ >`__
132+ - pyOpenSci tutorial on
133+ `pyproject.toml metadata <https://www.pyopensci.org/python-package-guide/tutorials/pyproject-toml.html >`__
134+
119135
120136
121137Exercises 1
@@ -128,11 +144,21 @@ Exercises 1
128144 - Create a new folder outside of our example project
129145 - Create a new virtual environment (:ref: `dependency_management `)
130146 - Install the example package from the project folder
131- into the new environment: ``$ pip install /path/to/project-folder/ ``
147+ into the new environment::
148+
149+ pip install --editable /path/to/project-folder/
150+
132151 - Test the local installation:
133152
134153 .. literalinclude :: packaging-example-project/test.py
135154
155+ - Make a change in the ``subtract `` function above such that it always
156+ returns a float ``return float(x - y) ``.
157+
158+ - Open a new Python console and test the following lines. Compare it with
159+ the previous output.
160+
161+ .. literalinclude :: packaging-example-project/test_editable.py
136162
137163Sharing packages via PyPI
138164-------------------------
0 commit comments