Skip to content

Commit 58305e6

Browse files
authored
Merge pull request #316 from bzzzzzz/master
Update pygradle to gradle 5
2 parents f2d4909 + 6674de0 commit 58305e6

File tree

13 files changed

+28
-15
lines changed

13 files changed

+28
-15
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ jobs:
55
- image: openjdk:8-jdk
66
environment:
77
_JAVA_OPTIONS: "-Xmx1024m -Xms256m"
8+
GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx1024m -Dorg.gradle.daemon=false
89
steps:
910
- run:
1011
name: Prepare System
@@ -27,7 +28,7 @@ jobs:
2728
- ~/.gradle
2829
- run:
2930
name: Run Build
30-
command: ./gradlew build --console plain --max-workers=2
31+
command: ./gradlew build --console plain --max-workers=2 -Dorg.gradle.daemon=false
3132

3233
- run:
3334
name: Save test results

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ We support PyGradle on the following software versions.
7676
| Software | Version |
7777
|----------|---------|
7878
| Java | 8.0 |
79-
| Gradle | 4.0 |
79+
| Gradle | 5.0 |
8080

8181
We're happy to review and merge pull requests that add additional support to
8282
future versions of software.

gradle/wrapper/gradle-wrapper.jar

4 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip

pivy-importer/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'application'
55
id "com.github.jk1.dependency-license-report" version "0.3.4"
66
id "com.github.hierynomus.license" version "0.13.1"
7-
id "com.github.johnrengelman.shadow" version "2.0.2"
7+
id "com.github.johnrengelman.shadow" version "5.1.0"
88
}
99

1010
apply from: "$rootDir/gradle/code-quality.gradle"

pivy-importer/src/main/groovy/com/linkedin/python/importer/util/ProxyDetector.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import org.apache.http.HttpHost
2121
@Slf4j
2222
class ProxyDetector {
2323

24-
private final static String HTTP_PROXY_HOST="http.proxyHost"
25-
private final static String HTTP_PROXY_PORT="http.proxyPort"
24+
private final static String HTTP_PROXY_HOST = "http.proxyHost"
25+
private final static String HTTP_PROXY_PORT = "http.proxyPort"
2626

2727
static maybeGetHttpProxy() {
28-
int proxyPort=-1
28+
int proxyPort = -1
2929

3030
def proxyPortString = System.getProperty(HTTP_PROXY_PORT)
3131
def proxyHost = System.getProperty(HTTP_PROXY_HOST)

pygradle-plugin/src/main/groovy/com/linkedin/gradle/python/plugin/WheelFirstPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void apply(Project project) {
5050
project.getPlugins().withType(PythonPlugin.class, plugin -> {
5151

5252
EditablePythonAbiContainer supportedWheelFormats = ExtensionUtils.getEditablePythonAbiContainer(project);
53-
FileBackedWheelCache wheelCache = new FileBackedWheelCache(cacheDir, supportedWheelFormats);
53+
FileBackedWheelCache wheelCache = new FileBackedWheelCache(cacheDir, supportedWheelFormats.copy());
5454

5555
tasks.withType(ProvidesVenv.class, it -> it.setEditablePythonAbiContainer(supportedWheelFormats));
5656

pygradle-plugin/src/main/groovy/com/linkedin/gradle/python/tasks/ParallelWheelGenerationTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public class ParallelWheelGenerationTask extends DefaultTask implements Supports
6262

6363
private static final Logger logger = Logging.getLogger(ParallelWheelGenerationTask.class);
6464

65-
@Input
6665
private WheelCache wheelCache;
6766

6867
private Set<String> currentPackages = Collections.newSetFromMap(new ConcurrentHashMap<>());
@@ -249,6 +248,7 @@ public void setFilesToConvert(FileCollection filesToConvert) {
249248
this.filesToConvert = filesToConvert;
250249
}
251250

251+
@Input
252252
public WheelCache getWheelCache() {
253253
return wheelCache;
254254
}

pygradle-plugin/src/main/groovy/com/linkedin/gradle/python/tasks/PyTestTask.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package com.linkedin.gradle.python.tasks
1717

1818
import groovy.transform.CompileStatic
19-
import org.gradle.api.internal.tasks.options.Option
19+
import org.gradle.api.tasks.options.Option
2020
import org.gradle.process.ExecResult
2121

2222
/**

pygradle-plugin/src/main/groovy/com/linkedin/gradle/python/wheel/PythonAbiContainer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,9 @@ public interface PythonAbiContainer extends Serializable {
3636
* @return true is the python exec is compatible
3737
*/
3838
boolean matchesSupportedVersion(File pythonExecutable, String pythonTag, String abiTag, String platformTag);
39+
40+
/**
41+
* Create and return a new object with the same containers
42+
*/
43+
PythonAbiContainer copy();
3944
}

pygradle-plugin/src/main/groovy/com/linkedin/gradle/python/wheel/internal/DefaultPythonAbiContainer.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ public boolean matchesSupportedVersion(File pythonExecutable, String pythonTag,
5050
.anyMatch(it -> contains(it, pythonTags, abiTags, platformTags));
5151
}
5252

53+
@Override
54+
public EditablePythonAbiContainer copy() {
55+
DefaultPythonAbiContainer container = new DefaultPythonAbiContainer();
56+
container.supportedAbis = new ArrayList<>(supportedAbis);
57+
return container;
58+
}
59+
5360
private static boolean contains(AbiDetails triple, String[] pythonTags, String[] abiTags, String[] platformTags) {
5461
return contains(triple.getPythonTag(), pythonTags)
5562
&& contains(triple.getAbiTag(), abiTags)

pygradle-plugin/src/test/groovy/com/linkedin/gradle/python/util/DependencyOrderTest.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class DependencyOrderTest extends Specification {
125125
configuration = Stub(Configuration) {
126126
getIncoming() >> Stub(ResolvableDependencies) {
127127
getResolutionResult() >> Stub(ResolutionResult) {
128-
getRoot() >> root
128+
it.getRoot() >> root
129129
}
130130
}
131131
getResolvedConfiguration() >> Stub(ResolvedConfiguration) {
@@ -155,7 +155,7 @@ class DependencyOrderTest extends Specification {
155155

156156
def "postOrderDependencies handles circular dependencies well"() {
157157
setup: "make the root with circular dependencies"
158-
def dependencies = new LinkedHashSet<ResolvedComponentResult>()
158+
def deps = new LinkedHashSet<ResolvedComponentResult>()
159159
def seen = new HashSet<ComponentIdentifier>()
160160

161161
// add the 4th branch for circular dependency test
@@ -167,11 +167,11 @@ class DependencyOrderTest extends Specification {
167167
}
168168

169169
when: "called with circular dependencies in the tree"
170-
DependencyOrder.postOrderDependencies(root, seen, dependencies)
170+
DependencyOrder.postOrderDependencies(root, seen, deps)
171171

172172
then: "returns dependencies in post-order cutting the recursion at the circular dependency"
173173
// comparing string representations because sets would match even with a wrong order
174-
dependencies.toString() == expectedDependencies.toString()
174+
deps.toString() == expectedDependencies.toString()
175175

176176
cleanup:
177177
expectedDependencies.removeAll(expectedCircularBranch)

version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=0.11.1
1+
version=0.12.0

0 commit comments

Comments
 (0)