Adding optional specs to contrib libraries?

182 views
Skip to first unread message

Sean Corfield

unread,
May 30, 2016, 4:49:32 PM5/30/16
to cloju...@googlegroups.com
Thoughts on this topic?

I went ahead and added a first cut of a spec to clojure.java.jdbc in an optional namespace:

https://github.com/clojure/java.jdbc/blob/master/src/main/clojure/clojure/java/jdbc/spec.clj

The tests attempt to require this and instrument the main namespace:

https://github.com/clojure/java.jdbc/blob/master/src/test/clojure/clojure/java/test_jdbc.clj#L27-L31

When running the tests on 1.9.0, this brings the specs into play and checks all calls. When running on earlier versions, nothing extra is done.

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)




Sean Corfield

unread,
May 30, 2016, 6:37:25 PM5/30/16
to cloju...@googlegroups.com
A follow-up to this: since the build tries to compile every namespace, this fails the build – but running lein test-all locally works (across all versions from 1.4 to 1.9).

Why does the build process try to compile all the namespaces on all versions?

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

se...@corfield.org

unread,
May 30, 2016, 11:45:30 PM5/30/16
to cloju...@googlegroups.com

I updated the clojure.java.jdbc pom.xml to override the parent clojure-compile executions to suppress compilation for now, so I have a passing build phase. I believe it should be possible to enable compilation just for Clojure 1.9.0 via conditional profiles in Maven but I’m not sure I want to put in that much effort. At least now I should be able to push a release so folks can play with this…

 

…which begs the question, java.jdbc is at 0.6.1 now – if I make a release with an optional spec namespace, it’s technically backward compatible so 0.6.2 seems reasonable but… would 0.7.0 be a more sensible release version?

 

(I’m not planning to release a new version before we’ve had this discussion around Contrib libraries and clojure.spec but I’d like to include versioning in that discussion)

 

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org

 

Alex Miller

unread,
Jun 1, 2016, 7:32:50 AM6/1/16
to Clojure Dev
Hey Sean,

I'm on vacation this week but I'll follow up with you next week on this. 

Alex
Reply all
Reply to author
Forward
0 new messages