django-apiblueprint-view icon indicating copy to clipboard operation
django-apiblueprint-view copied to clipboard

Upgrade to drafter 4

Open chris48s opened this issue 7 years ago • 3 comments

https://github.com/apiaryio/drafter/releases/tag/v4.1.0

chris48s avatar Mar 13 '18 10:03 chris48s

In progress: https://github.com/kylef/draughtsman/issues/1

chris48s avatar May 09 '18 17:05 chris48s

draughtsman==0.2.0 supports drafter 4, but you've now forked/vendored it.

  • [x] update local draughtsman + re-apply library_path mod
  • [x] update refract - see https://github.com/chris48s/django-apiblueprint-view/pull/17
  • [x] update drafter build - see https://github.com/chris48s/draughtsman-minimal-repro/blob/master/.travis.yml
  • [x] make sure all the tests pass, account for non-BC changes
    • https://github.com/kylef/draughtsman/blob/master/CHANGELOG.md
    • https://github.com/kylef/refract.py/blob/master/CHANGELOG.md
    • https://github.com/apiaryio/drafter/blob/master/CHANGELOG.md
  • [x] drop testing/support for python 3.5 (refract needs >=3.6)

chris48s avatar Mar 28 '20 18:03 chris48s

Notes for FutureChris:

  • Drafter 4.1.0 and 5.0.0-rc.1 both drop description from JSON schema (and don't surface it anywhere else). Field descriptions are quite useful :( waaa
  • Drafter update requires some changes to blueprints from downstream users e.g: (array[object], fixed-type) --> (array, fixed-type) which aren't massively obvious from the drafter changelog, but are totally do-able.
  • Drafter 4 won't build in a default manylinux (even manylinux2014_x86_64) container - it throws CMake 3.6 or higher is required. You are running version 2.8.12.2
  • You can fix this by upgrading cmake, but then auditwheel throws ValueError: Could not find soname in django_apiblueprint_view.libs/libm-2-2333ee76.12.so. This means you can't build a valid manylinux wheel (auditwheel --repair wants to vendor in some additional libs)
  • There's a branch at https://github.com/chris48s/django-apiblueprint-view/compare/version3 - don't delete/rebase that because the branch has tagged commits on it e.g: https://github.com/chris48s/django-apiblueprint-view/releases/tag/3.0.0b5 - if you pick thi up again, make a new branch and cherry-pick
  • You did do a pre-release based on the version3 branch at https://pypi.org/project/django-apiblueprint-view/3.0.0b5/ just bundling the compiled libdrafter.so into a -any.whl which works on my machine, despite auditwheel not having run repair on it

Given Drafter 4:

  • Drops a useful feature
  • Requires non-trivial C faffing to package a valid wheel

I've backported some of the other useful bits from that branch on to master, but I'm going to stick with bundling drafter 3.2.7 for the moment. Maybe revisit when there's a stable drafter 5 available. There are various bits of useful code on the version3 branch.

chris48s avatar Apr 18 '20 20:04 chris48s