Skip to content

Commit ebcfb93

Browse files
committed
Handle ExpressionParseError #33
* Update README.rst with instructions for post-initialization usage Signed-off-by: Jono Yang <jyang@nexb.com>
1 parent 9c78ddb commit ebcfb93

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

README.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ To generate requirements-dev.txt after requirements.txt has been generated:
8989
./configure --init --dev
9090
python etc/scripts/gen_requirements_dev.py -s venv/lib/python<version>/site-packages/
9191
92+
Note: on Windows, the ``site-packages`` directory is located at ``venv\Lib\site-packages\``
93+
94+
.. code-block:: bash
95+
96+
python .\\etc\\scripts\\gen_requirements.py -s .\\venv\\Lib\\site-packages\\
97+
.\configure --init --dev
98+
python .\\etc\\scripts\\gen_requirements_dev.py -s .\\venv\\Lib\\site-packages\\
99+
92100
Collecting and generating ABOUT files for dependencies
93101
------------------------------------------------------
94102

@@ -118,6 +126,45 @@ files from the thirdparty directory to the pypi directory at
118126
https://github.com/nexB/thirdparty-packages
119127

120128

129+
Usage after project initialization
130+
----------------------------------
131+
132+
Once the ``requirements.txt`` and ``requirements-dev.txt`` has been generated
133+
and the project dependencies and their ABOUT files have been uploaded to
134+
thirdparty.aboutcode.org/pypi, you can configure the project without using the
135+
``--init`` option.
136+
137+
If the virtual env for the project becomes polluted, or you would like to remove
138+
it, use the ``--clean`` option:
139+
140+
.. code-block:: bash
141+
142+
./configure --clean
143+
144+
Then you can run ``./configure`` again to set up the project virtual environment.
145+
146+
To set up the project for development use:
147+
148+
.. code-block:: bash
149+
150+
./configure --dev
151+
152+
To update the project dependencies (adding, removing, updating packages, etc.),
153+
update the dependencies in ``setup.cfg``, then run:
154+
155+
.. code-block:: bash
156+
157+
./configure --clean # Remove existing virtual environment
158+
./configure --init # Create project virtual environment, pull in new dependencies
159+
source venv/bin/activate # Ensure virtual environment is activated
160+
python etc/scripts/gen_requirements.py -s venv/lib/python<version>/site-packages/ # Regenerate requirements.txt
161+
python etc/scripts/gen_requirements_dev.py -s venv/lib/python<version>/site-packages/ # Regenerate requirements-dev.txt
162+
pip install -r etc/scripts/requirements.txt # Install dependencies needed by etc/scripts/bootstrap.py
163+
python etc/scripts/bootstrap.py -r requirements.txt -r requirements-dev.txt --with-deps # Collect dependency wheels and their ABOUT files
164+
165+
Ensure that the generated ABOUT files are valid, then take the dependency wheels
166+
and ABOUT files and upload them to thirdparty.aboutcode.org/pypi.
167+
121168
Release Notes
122169
=============
123170

etc/scripts/utils_thirdparty.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,11 @@ def get_pip_hash(self):
814814
return f'--hash=sha256:{self.sha256}'
815815

816816
def get_license_keys(self):
817-
return LICENSING.license_keys(self.license_expression, unique=True, simple=True)
817+
try:
818+
keys = LICENSING.license_keys(self.license_expression, unique=True, simple=True)
819+
except license_expression.ExpressionParseError:
820+
return ['unknown']
821+
return keys
818822

819823
def fetch_license_files(self, dest_dir=THIRDPARTY_DIR):
820824
"""

0 commit comments

Comments
 (0)