Browse Source

address pylint nits

master
Niklas Rosenstein 10 months ago
parent
commit
5900761d0c
No known key found for this signature in database GPG Key ID: 6D269B33D25F6C6
3 changed files with 13 additions and 4 deletions
  1. + 2
    - 2
      src/shore/__main__.py
  2. + 8
    - 2
      src/shore/plugins/core.py
  3. + 3
    - 0
      src/shore/util/version.py

+ 2
- 2
src/shore/__main__.py

@ -139,10 +139,10 @@ def license(output_type, license_name):
data = get_license_metadata(license_name)
if output_type == 'json':
print(json.dumps(data(), sort_keys=True))
print(json.dumps(data, sort_keys=True))
elif output_type == 'text':
print(wrap_license_text(data['license_text']))
elif ouutput_type == 'notice':
elif output_type == 'notice':
print(wrap_license_text(data['standard_notice'] or data['license_text']))
else:
raise RuntimeError(output_type)

+ 8
- 2
src/shore/plugins/core.py

@ -157,8 +157,14 @@ def get_monorepo_interdependency_version_refs(monorepo: Monorepo, new_version: V
if version_selector.is_semver_selector():
new_version_selector = VersionSelector(str(version_selector)[0] + str(new_version))
else:
logger.warning('%s: %s %s does not match version %s of monorepo %s and cannot be automatically bumped.',
package.filename, name, version_selector, new_version, subject.name)
logger.warning(
'%s: "%s %s" does not match version %r of monorepo %r and cannot be automatically bumped.',
package.filename,
package_name,
version_selector,
new_version,
monorepo.name,
)
if new_version_selector:
yield VersionSelectorRef(package.filename, match.start(2), match.end(2),
package_name, str(version_selector), str(new_version_selector))

+ 3
- 0
src/shore/util/version.py

@ -22,8 +22,11 @@
from packaging.version import Version as _Version
from nr.utils.git import Git
from typing import Optional, Union
import logging
import re
logger = logging.getLogger(__name__)
class Version(_Version):
""" An extension of #packageing.version.Version which supports a

Loading…
Cancel
Save