forked from pypa/setuptools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pypa#1559 from RajdeepRao/BUG-1551
Disallow files for license inputs
- Loading branch information
Showing
6 changed files
with
75 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
File inputs for the `license` field in `setup.cfg` files now explicitly raise an error. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,3 @@ universal = 1 | |
license_file = LICENSE | ||
|
||
[bumpversion:file:setup.py] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import contextlib | ||
import pytest | ||
|
||
from distutils.errors import DistutilsOptionError, DistutilsFileError | ||
from mock import patch | ||
from setuptools.dist import Distribution, _Distribution | ||
from setuptools.config import ConfigHandler, read_configuration | ||
from . import py2_only, py3_only | ||
from .textwrap import DALS | ||
|
||
class ErrConfigHandler(ConfigHandler): | ||
"""Erroneous handler. Fails to implement required methods.""" | ||
|
@@ -146,6 +148,24 @@ def test_basic(self, tmpdir): | |
assert metadata.download_url == 'http://test.test.com/test/' | ||
assert metadata.maintainer_email == '[email protected]' | ||
|
||
def test_license_cfg(self, tmpdir): | ||
fake_env( | ||
tmpdir, | ||
DALS(""" | ||
[metadata] | ||
name=foo | ||
version=0.0.1 | ||
license=Apache 2.0 | ||
""") | ||
) | ||
|
||
with get_dist(tmpdir) as dist: | ||
metadata = dist.metadata | ||
|
||
assert metadata.name == "foo" | ||
assert metadata.version == "0.0.1" | ||
assert metadata.license == "Apache 2.0" | ||
|
||
def test_file_mixed(self, tmpdir): | ||
|
||
fake_env( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters