Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to over-ride license metadata #20

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ Options for 'dist_conda' command:
`command_options`. Defaults to the current Python
version.
--build-number (-n) Conda build number. Defaults to zero
--license Manually specify the type of license for the conda
package. Defaults to the license defined in the
package metadata.
--license-file (-l) License file to include in the conda package.
Defaults to any file in the working directory
named 'LICENSE', 'COPYING', or 'COPYRIGHT', case
Expand Down
14 changes: 14 additions & 0 deletions setuptools_conda/setuptools_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,16 @@ class dist_conda(Command):
),
),
('build-number=', 'n', "Conda build number. Defaults to zero"),
(
'license=',
None,
dedent(
"""
Manually specify the type of license for the conda package.
Defaults to the license defined in the package metadata.
"""
)
),
(
'license-file=',
'l',
Expand Down Expand Up @@ -494,6 +504,7 @@ def initialize_options(self):
self.ignore_run_exports = []
self.channels = None
self.HOME = self.distribution.get_url()
self.license = None
self.LICENSE = self.distribution.get_license()
self.SUMMARY = self.distribution.get_description()

Expand All @@ -518,6 +529,9 @@ def initialize_options(self):
self.croot = None

def finalize_options(self):
if self.license is not None:
# use license over-ride
self.LICENSE = self.license
if self.license_file is None:
msg = """No file called LICENSE, COPYING or COPYRIGHT with any extension
found"""
Expand Down
Loading