Skip to content

Commit

Permalink
Update README.rst #33
Browse files Browse the repository at this point in the history
Signed-off-by: Jono Yang <[email protected]>
  • Loading branch information
JonoYang committed Sep 2, 2021
1 parent 288532d commit a5ae4f3
Showing 1 changed file with 67 additions and 2 deletions.
69 changes: 67 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ A Simple Python Project Skeleton
================================
This repo attempts to standardize our python repositories using modern python
packaging and configuration techniques. Using this `blog post`_ as inspiration, this
repository will serve as the base for all new python projects and will be adopted to all
repository will serve as the base for all new python projects and will be adopted to all
our existing ones as well.

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


Customizing
-----------

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

Initializing a project
----------------------

All projects using the skeleton will be expected to pull all of it dependencies
from thirdparty.aboutcode.org/pypi or the local thirdparty directory, using
requirements.txt and/or requirements-dev.txt to determine what version of a
package to collect. By default, PyPI will not be used to find and collect
packages from.

In the case where we are starting a new project where we do not have
requirements.txt and requirements-dev.txt and whose dependencies are not yet on
thirdparty.aboutcode.org/pypi, we run the following command after adding and
customizing the skeleton files to your project:

.. code-block:: bash
./configure --init
This will initialize the virtual environment for the project, pull in the
dependencies from PyPI and add them to the virtual environment.

Generating requirements.txt and requirements-dev.txt
----------------------------------------------------

After the project has been initialized, we can generate the requirements.txt and
requirements-dev.txt files.

Ensure the virtual environment is enabled.

To generate requirements.txt:

.. code-block:: bash
python etc/scripts/gen_requirements.py -s tmp/lib/python<version>/site-packages/
Replace \<version\> with the version number of the Python being used.

To generate requirements-dev.txt after requirements.txt has been generated:

.. code-block:: bash
./configure --dev
source tmp/bin/activate
python etc/scripts/gen_requirements_dev.py -s tmp/lib/python<version>/site-packages/
Collecting and generating ABOUT files for dependencies
------------------------------------------------------

Once we have requirements.txt and requirements-dev.txt, we can fetch the project
dependencies as wheels and generate ABOUT files for them:

.. code-block:: bash
python etc/scripts/bootstrap.py -r requirements.txt -r requirements-dev.txt --with-deps
There may be issues with the generated ABOUT files, which will have to be
corrected. You can check to see if your corrections are valid by running:

.. code-block:: bash
python etc/scripts/check_thirdparty.py -d thirdparty
Once the wheels are collected and the ABOUT files are generated and correct,
upload them to thirdparty.aboutcode.org/pypi by placing the wheels and ABOUT
files from the thirdparty directory to the pypi directory at
https://github.com/nexB/thirdparty-packages


Release Notes
-------------
Expand Down

0 comments on commit a5ae4f3

Please sign in to comment.