periph / devices

Go·Hardware·Lean - Device drivers
https://periph.io
Apache License 2.0
85 stars 42 forks source link

waveshare2in13v2: Remove dependencies on fogleman/gg and golang/freetype #28

Closed hansmi closed 2 years ago

hansmi commented 2 years ago

The waveshare2in13v2 example was evidently copied from the epd example, but didn't comment out the code pulling in additional dependencies.

codecov-commenter commented 2 years ago

Codecov Report

Merging #28 (531a995) into main (d92a4ed) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##            main     #28   +/-   ##
=====================================
  Coverage   60.3%   60.3%           
=====================================
  Files         48      48           
  Lines       6453    6453           
=====================================
  Hits        3893    3893           
  Misses      2425    2425           
  Partials     135     135           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d92a4ed...531a995. Read the comment docs.

maruel commented 2 years ago

On one hand, I don't mind too much because it's in a test, thus it is not actually used anywhere. On the other hand, it's true that it means everyone fetches more than needed.

I reread https://go.dev/doc/go1.17#go-command and realized the package has to have a specific go 1.17 to use the new module graph pruning which is a bit unfortunate.

hansmi commented 2 years ago

Oh, I wasn't aware of pruned module graphs in 1.17. Thank you for pointing that out!

I think long-term that'll be the better path (with being provided by upstream) than the alternative of treating examples as their own packages and directories with a local go.mod and go.sum.

If I'm reading the go.mod documentation for the go directive correctly it would be perfectly fine to update to a 1.17 go.mod. Older versions would continue to download all dependencies while 1.17 and newer would prune the graph.

Of course this is a more generic topic than this particular PR.