Skip to content

Commit

Permalink
Merge pull request #22 from Safe/773-hub-verify-fix
Browse files Browse the repository at this point in the history
Fix: regression for valid filename
  • Loading branch information
ryanscovill authored and GitHub Enterprise committed May 12, 2023
2 parents 3d704e0 + ec0e0ba commit df97e5c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 31 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# fme-packager changes

# 1.4.3

* Improve verify command

# 1.4.2

* Improve help validation for packages containing formats.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Available templates:

* `transformer`: [Transformer template for FME Packages](https://github.com/safesoftware/fpkg-transformer-template)

_These templates are not currently bundled with fme-packager.
_These templates are not currently bundled with fme-packager._


## Make an fpkg distribution
Expand Down
2 changes: 1 addition & 1 deletion fme_packager/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.4.2"
__version__ = "1.4.3"
10 changes: 0 additions & 10 deletions fme_packager/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ def _unzip_and_build(self):
steps.build()
steps.make_fpkg()

# Verify package file name is the same
if not os.path.exists(pathlib.Path(temp_dir) / "dist" / os.path.basename(self.file)):
raise ValueError(
"The file name is invalid. Expected {}".format(
build_fpkg_filename(
steps.metadata.publisher_uid, steps.metadata.uid, steps.metadata.version
)
)
)

def _print(self, msg):
if self.verbose:
print(msg)
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
License :: OSI Approved :: BSD License
Intended Audience :: Developers

Expand Down Expand Up @@ -43,6 +44,7 @@ dev =
black
tox
twine
urllib3<2

[options.entry_points]
console_scripts =
Expand Down
19 changes: 0 additions & 19 deletions tests/test_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,3 @@ def test_verify_non_existant():
runner = CliRunner()
result = runner.invoke(verify, [str(CWD / "fixtures" / "does-not-exist.fpkg")])
assert "The file must exist and have a .fpkg extension" in result.output


@pytest.mark.parametrize("flags", [[], ["--json"]])
def test_verify_wrong_filename(flags):
runner = CliRunner()
result = runner.invoke(
verify,
[
str(CWD / "fixtures" / "fpkgs" / "example.my-package-changed-filename-0.1.0.fpkg"),
*flags,
],
)
if "--json" in flags:
assert (
'{"status": "error", "message": "The file name is invalid. Expected example.my-package-0.1.0.fpkg"}'
in result.output
)
else:
assert "The file name is invalid. Expected example.my-package-0.1.0.fpkg" in result.output

0 comments on commit df97e5c

Please sign in to comment.