Skip to content

Commit

Permalink
Default values for list/set query&header params (#624)
Browse files Browse the repository at this point in the history
* Default values for list/set query&header params

* cl

* require python >=3.8

* Revert "require python >=3.8"

This reverts commit 1b9105a.

* Backport: Break: Stop testing on python 2 (#475)

Co-authored-by: Robert Kruszewski <[email protected]>
  • Loading branch information
pnepywoda and robert3005 authored Oct 20, 2022
1 parent 6112827 commit d83ee8f
Show file tree
Hide file tree
Showing 26 changed files with 376 additions and 352 deletions.
65 changes: 23 additions & 42 deletions .baseline/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<!--
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
Palantir Baseline Checkstyle configuration.
Authors: Robert Fink, Brian Worth, Merrick Zoubeiri, and many other contributors. Based in part on http://checkstyle.sourceforge.net/google_style.html
Please keep checks alphabetized with one exception: "relaxed" checks are grouped together at the bottom for easier disabling.
Check-specific comments reference documents internal to Palantir and can be safely ignored or removed.
-->

--><!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="error"/>
Expand Down Expand Up @@ -47,6 +41,10 @@
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<module name="LineLength"> <!-- Java Style Guide: No line-wrapping -->
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="TreeWalker">
<module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md -->
<module name="SuppressionCommentFilter">
Expand All @@ -65,7 +63,9 @@
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="AnnotationUseStyle"/> <!-- Java Style Guide: Annotations -->
<module name="AnnotationUseStyle"> <!-- Java Style Guide: Annotations -->
<property name="trailingArrayComma" value="ignore"/>
</module>
<module name="ArrayTypeStyle"/> <!-- Java Style Guide: No C-style array declarations -->
<module name="AvoidEscapedUnicodeCharacters"> <!-- Java Style Guide: Non-ASCII characters -->
<property name="allowEscapesForControlCharacters" value="true"/>
Expand All @@ -77,14 +77,7 @@
</module>
<module name="AvoidStarImport"/> <!-- Java Style Guide: No wildcard imports -->
<module name="AvoidStaticImport"> <!-- Java Style Guide: No static imports -->
<property name="excludes" value="
com.google.common.base.Preconditions.*,
com.palantir.logsafe.Preconditions.*,
java.util.Collections.*,
java.util.stream.Collectors.*,
org.apache.commons.lang3.Validate.*,
org.assertj.core.api.Assertions.*,
org.mockito.Mockito.*"/>
<property name="excludes" value="com.google.common.base.Preconditions.*, com.palantir.logsafe.Preconditions.*, java.util.Collections.*, java.util.stream.Collectors.*, org.apache.commons.lang3.Validate.*, org.assertj.core.api.Assertions.*, org.mockito.Mockito.*"/>
</module>
<module name="ClassTypeParameterName"> <!-- Java Style Guide: Type variable names -->
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
Expand Down Expand Up @@ -134,12 +127,12 @@
<module name="IllegalImport"> <!-- Java Coding Guidelines: Import the canonical package -->
<property name="id" value="BanShadedClasses"/>
<property name="illegalPkgs" value=".*\.(repackaged|shaded|thirdparty)"/>
<property name="regexp" value="true" />
<property name="regexp" value="true"/>
<message key="import.illegal" value="Must not import repackaged classes."/>
</module>
<module name="IllegalImport">
<property name="illegalPkgs" value="^org\.gradle\.(internal|.*\.internal)"/>
<property name="regexp" value="true" />
<property name="regexp" value="true"/>
<message key="import.illegal" value="Do not rely on gradle internal classes as these may change in minor releases - use org.gradle.api versions instead."/>
</module>
<module name="IllegalImport">
Expand Down Expand Up @@ -192,11 +185,9 @@
<property name="separated" value="true"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
</module>

<module name="InnerAssignment"/> <!-- Java Coding Guidelines: Inner assignments: Not used -->
<module name="LineLength"> <!-- Java Style Guide: No line-wrapping -->
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<!-- Java Style Guide: Nonempty blocks: K & R style -->
<module name="MemberName"> <!-- Java Style Guide: Non-constant field names -->
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
<message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
Expand Down Expand Up @@ -237,6 +228,7 @@
<message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterAssignment"/> <!-- Java Coding Guidelines: Final variables and parameters -->
<!-- Java Style Guide: Horizontal whitespace -->
<module name="RedundantImport"/> <!-- Java Style Guide: No unused imports -->
<module name="RedundantModifier"/> <!-- Java Coding Guidelines: Avoid redundant modifiers -->
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Use appropriate assertion methods -->
Expand Down Expand Up @@ -352,7 +344,7 @@
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="\bCharset.defaultCharset\("/>
<property name="message" value="Use explicit charset (e.g. StandardCharsets.UTF-8) instead of default."/>
<property name="message" value="Use explicit charset (e.g. StandardCharsets.UTF_8) instead of default."/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="\bIOUtils\.toString\("/>
Expand All @@ -361,18 +353,19 @@
<module name="RegexpSinglelineJava">
<property name="format" value="\/\/TODO|\/\/ TODO(?!\([^()\s]+\): )"/>
<property name="message" value="TODO format: // TODO(#issue): explanation"/>
<property name="ignoreCase" value="true"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="(void setUp\(\))|(void setup\(\))|(void setupStatic\(\))|(void setUpStatic\(\))|(void beforeTest\(\))|(void teardown\(\))|(void tearDown\(\))|(void beforeStatic\(\))|(void afterStatic\(\))"/>
<property name="message" value="Test setup/teardown methods are called before(), beforeClass(), after(), afterClass(), but not setUp, teardown, etc."/>
</module>
<module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
<property name="option" value="same"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
</module>
<module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
<property name="option" value="alone"/>
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
<property name="tokens" value="LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
</module>
<module name="SeparatorWrap"> <!-- Java Style Guide: Where to break -->
<property name="tokens" value="DOT"/>
Expand All @@ -390,7 +383,7 @@
<module name="SuppressWarnings">
<property name="format" value="serial"/>
</module>
<module name="SuppressWarningsHolder" /> <!-- Required for SuppressWarningsFilter -->
<module name="SuppressWarningsHolder"/> <!-- Required for SuppressWarningsFilter -->
<module name="TypeName"> <!-- Java Style Guide: Class names -->
<message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
Expand All @@ -401,16 +394,7 @@
<module name="UpperEll"/> <!-- Java Style Guide: Numeric Literals -->
<module name="VisibilityModifier"/> <!-- Java Coding Guidelines: Minimize mutability -->
<module name="WhitespaceAfter"/> <!-- Java Style Guide: Horizontal whitespace -->
<module name="WhitespaceAround"> <!-- Java Style Guide: Horizontal whitespace -->
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="ignoreEnhancedForColon" value="false"/>
<message key="ws.notFollowed" value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
<message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>


<!-- Stricter checks begin: delete some or all of the following for faster prototyping, but please restore before pushing to production. -->

Expand All @@ -423,13 +407,10 @@
<property name="ignoredAnnotations" value="ParameterizedTest, Test, Before, BeforeEach, After, AfterEach, BeforeClass, BeforeAll, AfterClass, AfterAll"/>
</module>
<module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used -->
<property name="scope" value="public"/>
<property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="minLineCount" value="99999999"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
</module>
<module name="JavadocStyle"/> <!-- Java Style Guide: Javadoc -->
<module name="JavadocTagContinuationIndentation"> <!-- Java Style Guide: At-clauses -->
Expand Down Expand Up @@ -462,4 +443,4 @@

<!-- Stricter checks end -->
</module>
</module>
</module>
12 changes: 12 additions & 0 deletions .baseline/idea/intellij-java-palantir-style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@
<package name="" withSubpackages="true" static="false" />
</value>
</option>
<DO_NOT_IMPORT_INNER>
<CLASS name="Builder" />
<CLASS name="Callback" />
<CLASS name="Class" />
<CLASS name="Entry" />
<CLASS name="Enum" />
<CLASS name="Factory" />
<CLASS name="Type" />
<CLASS name="Key" />
<CLASS name="Id" />
<CLASS name="Provider" />
</DO_NOT_IMPORT_INNER>
</GroovyCodeStyleSettings>
<option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
<option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
Expand Down
93 changes: 4 additions & 89 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/openjdk:8u171-jdk-node-browsers
- image: cimg/openjdk:11.0.10-node
environment:
GRADLE_OPTS: -Dorg.gradle.console=plain -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false

Expand Down Expand Up @@ -47,84 +47,9 @@ jobs:
paths:
- '.'

py27:
docker:
- image: circleci/python:2.7.15
working_directory: ~/project/conjure-python-verifier/python
steps:
- checkout:
path: ~/project

- attach_workspace:
at: '~/project'

- run:
name: Install dependencies
command: pip install --user setuptools tox==2.9.1 tox-virtualenv-no-download

- restore_cache:
key: tox-v2-py27-{{ checksum "tox.ini" }}-{{ checksum "setup.py" }}

- run:
name: Install tox things
command: if [ ! -d ".tox" ]; then python -m tox -e py27 --notest; fi

- save_cache:
key: tox-v2-py27-{{ checksum "tox.ini" }}-{{ checksum "setup.py" }}
paths:
- .tox

- run: python -m tox -e py27

- run:
name: Collect JUnit XML
command: mkdir -p ~/junit && find . -type f -regex ".*/build/.*xml" -exec cp {} ~/junit/ \;
when: always

- store_test_results:
path: ~/junit

mypy27:
docker:
- image: circleci/python:3.6.5
working_directory: ~/project/conjure-python-verifier/python
steps:
- checkout:
path: ~/project

- attach_workspace:
at: '~/project'

- run:
name: Install dependencies
command: pip install --user setuptools tox==2.9.1 tox-virtualenv-no-download

- restore_cache:
key: tox-v2-mypy27-{{ checksum "tox.ini" }}-({ checksum "setup.py" })

- run:
name: Install tox things
command: if [ ! -d ".tox" ]; then python -m tox -e mypy27 --notest; fi

- save_cache:
key: tox-v2-mypy27-{{ checksum "tox.ini" }}-({ checksum "setup.py" })
paths:
- .tox

- run: mkdir build
- run: python -m tox -e mypy27

- run:
name: Collect JUnit XML
command: mkdir -p ~/junit && find . -type f -regex ".*/build/.*xml" -exec cp {} ~/junit/ \;
when: always

- store_test_results:
path: ~/junit

py3:
docker:
- image: circleci/python:3.6.5
- image: cimg/python:3.6.15
working_directory: ~/project/conjure-python-verifier/python
steps:
- checkout:
Expand Down Expand Up @@ -161,7 +86,7 @@ jobs:

mypy3:
docker:
- image: circleci/python:3.6.5
- image: cimg/python:3.6.15
working_directory: ~/project/conjure-python-verifier/python
steps:
- checkout:
Expand Down Expand Up @@ -199,7 +124,7 @@ jobs:

publish:
docker:
- image: circleci/openjdk:8u171-jdk-node-browsers
- image: cimg/openjdk:11.0.10-node
steps:
- checkout
- restore_cache:
Expand All @@ -217,28 +142,18 @@ workflows:
jobs:
- build:
<<: *always-run
- py27:
requires:
- build
<<: *always-run
- py3:
requires:
- build
<<: *always-run
- mypy27:
requires:
- build
<<: *always-run
- mypy3:
requires:
- build
<<: *always-run
- publish:
requires:
- build
- py27
- py3
- mypy27
- mypy3
filters:
branches:
Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ buildscript {

dependencies {
classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.4.0'
classpath 'com.palantir.javaformat:gradle-palantir-java-format:1.0.1'
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.17.2'
classpath 'com.palantir.baseline:gradle-baseline-java:3.14.1'
classpath 'com.palantir.gradle.conjure:gradle-conjure:4.18.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2'
classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.17.0'
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.8.0'
classpath 'com.palantir.baseline:gradle-baseline-java:4.73.0'
classpath 'com.palantir.gradle.conjure:gradle-conjure:5.20.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.13.0'
classpath 'gradle.plugin.org.inferred:gradle-processors:3.6.0'
}
}
Expand All @@ -54,7 +54,7 @@ subprojects {
apply plugin: 'java-library'
apply plugin: 'org.inferred.processors'

sourceCompatibility = 1.8
sourceCompatibility = 11

tasks.withType(JavaCompile) {
options.compilerArgs += ['-Werror']
Expand Down
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-475.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: break
break:
description: Stop testing on python 2
links:
- https://github.com/palantir/conjure-python/pull/475
6 changes: 6 additions & 0 deletions changelog/@unreleased/pr-624.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: improvement
improvement:
description: |-
Default values for list/set query&header params (backport)
links:
- https://github.com/palantir/conjure-python/pull/624
Loading

0 comments on commit d83ee8f

Please sign in to comment.