Skip to content

Commit

Permalink
fix, python: do not manually specify custom license file (#3697)
Browse files Browse the repository at this point in the history
  • Loading branch information
armandobelardo committed May 24, 2024
1 parent cda7b10 commit e602015
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 5 additions & 1 deletion generators/python/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.5.3] - 2024-05-24

- Fix: Stop specifying custom licenses manually, let poetry handle adding them.

## [2.5.2] - 2024-05-23

- Fix: Support `list` SDK method names instead of defaulting to `list_`.
- Fix: Support `list` SDK method names instead of defaulting to `list_`.

## [2.5.1-rc0] - 2024-05-23

Expand Down
2 changes: 1 addition & 1 deletion generators/python/sdk/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.2
2.5.3
5 changes: 1 addition & 4 deletions generators/python/src/fern_python/codegen/pyproject_toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from fern.generator_exec.resources import (
BasicLicense,
CustomLicense,
GithubOutputMode,
LicenseConfig,
LicenseId,
Expand Down Expand Up @@ -129,6 +128,7 @@ def to_string(self) -> str:
project_urls.append(f"Homepage = '{self.pypi_metadata.homepage_link}'")

if self.license_ is not None:
# TODO(armandobelardo): verify poetry handles custom licenses on it's side
if self.license_.get_as_union().type == "basic":
license_id = cast(BasicLicense, self.license_.get_as_union()).id
if license_id == LicenseId.MIT:
Expand All @@ -137,9 +137,6 @@ def to_string(self) -> str:
elif license_id == LicenseId.APACHE_2:
license_evaluated = 'license = "Apache-2.0"'
classifiers.append("License :: OSI Approved :: Apache Software License")
else:
license_filename = cast(CustomLicense, self.license_.get_as_union()).filename
license_evaluated = f"license = {{ file = '{license_filename}' }}"

if self.github_output_mode is not None:
project_urls.append(f"Repository = '{self.github_output_mode.repo_url}'")
Expand Down

0 comments on commit e602015

Please sign in to comment.