Skip to content

Commit a5ae4f3

Browse files
committed
Update README.rst #33
Signed-off-by: Jono Yang <jyang@nexb.com>
1 parent 288532d commit a5ae4f3

File tree

1 file changed

+67
-2
lines changed

1 file changed

+67
-2
lines changed

README.rst

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ A Simple Python Project Skeleton
22
================================
33
This repo attempts to standardize our python repositories using modern python
44
packaging and configuration techniques. Using this `blog post`_ as inspiration, this
5-
repository will serve as the base for all new python projects and will be adopted to all
5+
repository will serve as the base for all new python projects and will be adopted to all
66
our existing ones as well.
77

88
.. _blog post: https://blog.jaraco.com/a-project-skeleton-for-python-projects/
@@ -33,7 +33,6 @@ Update an existing project
3333
3434
This is also the workflow to use when updating the skeleton files in any given repository.
3535

36-
3736
Customizing
3837
-----------
3938

@@ -42,6 +41,72 @@ You typically want to perform these customizations:
4241
- remove or update the src/README.rst and tests/README.rst files
4342
- check the configure and configure.bat defaults
4443

44+
Initializing a project
45+
----------------------
46+
47+
All projects using the skeleton will be expected to pull all of it dependencies
48+
from thirdparty.aboutcode.org/pypi or the local thirdparty directory, using
49+
requirements.txt and/or requirements-dev.txt to determine what version of a
50+
package to collect. By default, PyPI will not be used to find and collect
51+
packages from.
52+
53+
In the case where we are starting a new project where we do not have
54+
requirements.txt and requirements-dev.txt and whose dependencies are not yet on
55+
thirdparty.aboutcode.org/pypi, we run the following command after adding and
56+
customizing the skeleton files to your project:
57+
58+
.. code-block:: bash
59+
60+
./configure --init
61+
62+
This will initialize the virtual environment for the project, pull in the
63+
dependencies from PyPI and add them to the virtual environment.
64+
65+
Generating requirements.txt and requirements-dev.txt
66+
----------------------------------------------------
67+
68+
After the project has been initialized, we can generate the requirements.txt and
69+
requirements-dev.txt files.
70+
71+
Ensure the virtual environment is enabled.
72+
73+
To generate requirements.txt:
74+
75+
.. code-block:: bash
76+
77+
python etc/scripts/gen_requirements.py -s tmp/lib/python<version>/site-packages/
78+
79+
Replace \<version\> with the version number of the Python being used.
80+
81+
To generate requirements-dev.txt after requirements.txt has been generated:
82+
83+
.. code-block:: bash
84+
./configure --dev
85+
source tmp/bin/activate
86+
python etc/scripts/gen_requirements_dev.py -s tmp/lib/python<version>/site-packages/
87+
88+
Collecting and generating ABOUT files for dependencies
89+
------------------------------------------------------
90+
91+
Once we have requirements.txt and requirements-dev.txt, we can fetch the project
92+
dependencies as wheels and generate ABOUT files for them:
93+
94+
.. code-block:: bash
95+
96+
python etc/scripts/bootstrap.py -r requirements.txt -r requirements-dev.txt --with-deps
97+
98+
There may be issues with the generated ABOUT files, which will have to be
99+
corrected. You can check to see if your corrections are valid by running:
100+
101+
.. code-block:: bash
102+
103+
python etc/scripts/check_thirdparty.py -d thirdparty
104+
105+
Once the wheels are collected and the ABOUT files are generated and correct,
106+
upload them to thirdparty.aboutcode.org/pypi by placing the wheels and ABOUT
107+
files from the thirdparty directory to the pypi directory at
108+
https://github.com/nexB/thirdparty-packages
109+
45110

46111
Release Notes
47112
-------------

0 commit comments

Comments
 (0)