tools icon indicating copy to clipboard operation
tools copied to clipboard

Don't prefix identifier with `url:`

Open brendanny opened this issue 7 months ago • 5 comments

Addresses https://github.com/standardebooks/tools/issues/831

brendanny avatar May 20 '25 18:05 brendanny

Looks like https://github.com/standardebooks/tools/blob/0cf06403b2d0722687759500a919fed2ab959342/tests/file_commands/extract-ebook/test-1/golden/jane-austen_unknown-novel.epub.extracted/epub/content.opf#L4 also needs to be updated.

apasel422 avatar May 22 '25 17:05 apasel422

Looks fine on my end

https://github.com/standardebooks/tools/pull/834/files#diff-cb578716173f35be8ace6a64d6f62d70e03e78afa2964da879fb3cf82c9efcfd

brendanny avatar May 22 '25 18:05 brendanny

The tests are failing however, see the checks section at the bottom of this PR.

acabal avatar May 22 '25 18:05 acabal

I can't make too much sense of the test output, but I think they are failing because the github action is using the most recent tools release which has the url: prefix in the golden files.

brendanny avatar May 22 '25 18:05 brendanny

Oh wait, no. We have full epubs in here that I need to fix

brendanny avatar May 22 '25 19:05 brendanny

@brendanny I'm ready to merge this in but there have been changes since this PR, and now there are merge conflicts. Can you fix these so I can merge this in? Thanks!

acabal avatar Jul 08 '25 19:07 acabal

which one has the correct css?

@@ -66,6 +66,11 @@
        width: 25%;
 }
 
+section.epub-type-colophon p.nth-last-child-2 time,
+section.epub-type-colophon p:nth-last-child(2) time{
+       font-variant: small-caps;
+}
+
 section.epub-type-colophon a{
        font-variant: small-caps;
 }

brendanny avatar Jul 08 '25 22:07 brendanny

The one in tests/build/...

acabal avatar Jul 09 '25 01:07 acabal

these epub test will be the death of me... A full round-trip test seems more maintainable (no binary files in-repo, no tracking separate golden files for each, etc...)

One thing to note, and why my latest build failed :(

  • se clean changes the css in the extract and build tests.

brendanny avatar Jul 10 '25 17:07 brendanny

I think you must have fixed a merge conflict incorrectly somewhere, because the tests in head are working fine.

You can install pytest on your local machine to run them locally instead of waiting for Github. Running them locally is just a few seconds. See https://github.com/standardebooks/tools/blob/master/tests/README.md

acabal avatar Jul 10 '25 17:07 acabal

I suggest just copying the tests from master and pasting them into your PR. Tests are passing in master.

acabal avatar Jul 10 '25 20:07 acabal

that's what I had done, but had gotten mixed up because the epub in tests/file_commands/extract-ebook/... is an advanced epub but not labeled as such. Whereas the epubs in tests/build/... are normally named but the directory they're built from doesn't have a content.opf (which is required to build the golden epub) or a colophon

Should the the epubs and the golden dirs be identical? Why aren't they?

brendanny avatar Jul 10 '25 20:07 brendanny

Okay, this should be final and ready to merge now.

brendanny avatar Jul 10 '25 21:07 brendanny

Great work, thanks!

acabal avatar Jul 11 '25 14:07 acabal