Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
622d9c6c
Unverified
Commit
622d9c6c
authored
Aug 09, 2019
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve handling of licenses
parent
dcf2dc09
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
poetry/spdx/__init__.py
+4
-0
tests/spdx/test_license.py
+6
-0
tests/spdx/test_main.py
+9
-0
No files found.
poetry/spdx/__init__.py
View file @
622d9c6c
...
@@ -33,6 +33,10 @@ def load_licenses():
...
@@ -33,6 +33,10 @@ def load_licenses():
for
name
,
license
in
data
.
items
():
for
name
,
license
in
data
.
items
():
_licenses
[
name
.
lower
()]
=
License
(
name
,
license
[
0
],
license
[
1
],
license
[
2
])
_licenses
[
name
.
lower
()]
=
License
(
name
,
license
[
0
],
license
[
1
],
license
[
2
])
_licenses
[
license
[
0
]
.
lower
()]
=
_licenses
[
name
.
lower
()]
# Add a Proprietary license for non-standard licenses
_licenses
[
"proprietary"
]
=
License
(
"Proprietary"
,
"Proprietary"
,
False
,
False
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
tests/spdx/test_license.py
View file @
622d9c6c
...
@@ -42,3 +42,9 @@ def test_classifier_no_classifer():
...
@@ -42,3 +42,9 @@ def test_classifier_no_classifer():
license
=
license_by_id
(
"Leptonica"
)
license
=
license_by_id
(
"Leptonica"
)
assert
license
.
classifier
==
"License :: Other/Proprietary License"
assert
license
.
classifier
==
"License :: Other/Proprietary License"
def
test_proprietary_license
():
license
=
license_by_id
(
"Proprietary"
)
assert
"License :: Other/Proprietary License"
==
license
.
classifier
tests/spdx/test_main.py
View file @
622d9c6c
...
@@ -29,6 +29,15 @@ def test_license_by_id_is_case_insensitive():
...
@@ -29,6 +29,15 @@ def test_license_by_id_is_case_insensitive():
assert
license
.
id
==
"MIT"
assert
license
.
id
==
"MIT"
def
test_license_by_id_with_full_name
():
license
=
license_by_id
(
"GNU Lesser General Public License v3.0 or later"
)
assert
license
.
id
==
"LGPL-3.0-or-later"
assert
license
.
name
==
"GNU Lesser General Public License v3.0 or later"
assert
license
.
is_osi_approved
assert
not
license
.
is_deprecated
def
test_license_by_id_invalid
():
def
test_license_by_id_invalid
():
with
pytest
.
raises
(
ValueError
):
with
pytest
.
raises
(
ValueError
):
license_by_id
(
"invalid"
)
license_by_id
(
"invalid"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment