Skip to content

Commit

Permalink
Merge pull request #927 from reef-technologies/fix_nox_build
Browse files Browse the repository at this point in the history
fix `nox -s build` not gathering typeshed libs licenses properly
  • Loading branch information
mjurbanski-reef authored Oct 3, 2023
2 parents a81a775 + 7f75084 commit 3a07e29
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fetch-depth: 0
- uses: codespell-project/actions-codespell@2391250ab05295bddd51e36a8c6295edb6343b0e
with:
ignore_words_list: datas
ignore_words_list: datas re-use
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
uses: actions/setup-python@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Infrastructure
* Fix gathering licenses of typeshed libraries
* Fix spellcheck erroring out on LICENSE file

## [3.10.1] - 2023-09-27

### Fixed
Expand Down
10 changes: 8 additions & 2 deletions b2/console_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -3454,6 +3454,8 @@ class License(Command): # pragma: no cover
'https://raw.githubusercontent.com/PythonCharmers/python-future/master/LICENSE.txt',
'pefile':
'https://raw.githubusercontent.com/erocarrera/pefile/master/LICENSE',
'https://github.com/python/typeshed':
'https://raw.githubusercontent.com/python/typeshed/main/LICENSE',
}

class NormalizingStringIO(io.StringIO):
Expand Down Expand Up @@ -3591,8 +3593,12 @@ def _get_single_license(self, module_dict: dict):
assert 'MIT License' in license_ # let's make sure the license is still there
elif module_name == 'b2sdk':
license_ = (pathlib.Path(b2sdk.__file__).parent / 'LICENSE').read_text()
elif module_name in self.LICENSES:
license_ = self._fetch_license_from_url(self.LICENSES[module_name])
else:
license_url = self.LICENSES.get(module_name) or self.LICENSES.get(
module_dict.get('URL')
)
if license_url:
license_ = self._fetch_license_from_url(license_url)

assert license_ != piplicenses.LICENSE_UNKNOWN, module_name

Expand Down

0 comments on commit 3a07e29

Please sign in to comment.