Skip to content

Commit

Permalink
Merge branch 'master' into fix_class_newinstance_deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
xael-fry authored Mar 3, 2024
2 parents d372cce + e0916dd commit 2f02fcd
Show file tree
Hide file tree
Showing 79 changed files with 375 additions and 301 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
name: Check / Tests -> JDK-${{ matrix.jdk }}/${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
fetch-depth: 0

- name: Set up python 3
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: 'x64'
Expand All @@ -39,7 +39,7 @@ jobs:
- run: pip install -r python/requirements.txt

- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'adopt'
Expand All @@ -55,19 +55,19 @@ jobs:
name: BUILD ${{ github.sha }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
fetch-depth: 0

- name: Set up python 2
uses: actions/setup-python@v2
- name: Set up python 3
uses: actions/setup-python@v4
with:
python-version: '2.x'
python-version: '3.x'
architecture: 'x64'

- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'adopt'
Expand All @@ -77,7 +77,7 @@ jobs:
run: ant artifact

- name: ziping artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: play-${{ github.sha }}
if-no-files-found: error
Expand Down
1 change: 1 addition & 0 deletions documentation/manual/home.textile
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ h2. <a name="versionnotes">Version notes</a>
New versions of Play include certain changes. Check older release notes for:

# "About Play releases":releases/releases
# "Play 1.8.0":releases/release1.8.x/releasenotes-1.8.0
# "Play 1.7.1":releases/release1.7.x/releasenotes-1.7.1
# "Play 1.7.0":releases/release1.7.x/releasenotes-1.7.0
# "Play 1.6.0":releases/release1.6.x/releasenotes-1.6.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
h1. Play 1.8.0 -- Release notes

Play 1.8.0 has been released of the master branch.

The changes in this release are listed in [1.8.0 on github](https://github.com/playframework/play1/issues?q=milestone%3A1.8.0+) including 22 resolved tickets.


h2. What's new in Play 1.8.0

* [#1428](https://github.com/playframework/play1/issues/1428): add support for java 18, 19.

h2. What's fixed in Play 1.8.0

* [#1407](https://github.com/playframework/play1/issues/1407): Cleanup code
* [#1417](https://github.com/playframework/play1/issues/1417): Updated dependencies as of 20220618
* [#1425](https://github.com/playframework/play1/issues/1425): Updated dependencies
* [#1430](https://github.com/playframework/play1/issues/1430): NullPointer in JPABase.cascadeOrphans() caused by unused lines
* [#1431](https://github.com/playframework/play1/issues/1431): Bugfix/1430 do not get unused value
* [#1432](https://github.com/playframework/play1/issues/1432): Better compatibility with Hibernate Envers
* [#1433](https://github.com/playframework/play1/issues/1433): about play 1.7.1 log problem
* [#1437](https://github.com/playframework/play1/issues/1437): "play auto-test" can return a exit code zero when the tests don't run
* [#1435](https://github.com/playframework/play1/issues/1435): #1437: play auto-test can return an exit code of zero when the teà
* [#1438](https://github.com/playframework/play1/issues/1438): Upgrade Commons Lang
* [#1440](https://github.com/playframework/play1/issues/1440): Fix warnings with generics
* [#1441](https://github.com/playframework/play1/issues/1441): Dependency update 20230106
* [#1444](https://github.com/playframework/play1/issues/1444): Fix missing HTTPMessage.getHeader()
* [#1446](https://github.com/playframework/play1/issues/1446): Removed support for python 2.x in github action
* [#1447](https://github.com/playframework/play1/issues/1447): [#1146] test(python): use python 3 for build instead of deprecated python2
* [#1448](https://github.com/playframework/play1/issues/1448): Updated 3rd party dependencies
* [#1459](https://github.com/playframework/play1/issues/1459): Updated 3rd party dependencies
* [#1460](https://github.com/playframework/play1/issues/1460): Removed Python imp dependency
* [#1465](https://github.com/playframework/play1/issues/1465): #1457 python imp module
* [#1466](https://github.com/playframework/play1/issues/1466): Python AttributeError: module 'time' has no attribute 'clock'
* [#1467](https://github.com/playframework/play1/issues/1467): #1466 The clock function was removed from time module in Python 3.8
* [#1469](https://github.com/playframework/play1/issues/1469): feat(YamlParser): add SafeConstructor to enforce security
6 changes: 5 additions & 1 deletion documentation/manual/releases/releases.textile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ h1. About Play releases

You can download Play releases "here":https://www.playframework.com/download. Each release has a Migration Guide that explains how to upgrade from the previous release.

h2. Play 1.8.x

# "Play 1.8.0":release1.8.x/releasenotes-1.8.0

h2. Play 1.7.x

# "Play 1.7.1":release1.7.x/releasenotes-1.7.1
Expand Down Expand Up @@ -52,4 +56,4 @@ h2. Play 1.0.x

# "Play 1.0.3":release1.0.x/releasenotes-1.0.3
# "Play 1.0.2":release1.0.x/releasenotes-1.0.2
# "Play 1.0.1":release1.0.x/releasenotes-1.0.1
# "Play 1.0.1":release1.0.x/releasenotes-1.0.1
62 changes: 31 additions & 31 deletions framework/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,72 +9,72 @@ transitiveDependencies: false
require: &allDependencies
- antlr 2.7.7
- com.mchange -> c3p0 0.9.5.5
- com.zaxxer -> HikariCP 5.0.1
- org.ow2.asm -> asm 9.5
- org.ow2.asm -> asm-commons 9.5
- org.ow2.asm -> asm-util 9.5
- org.ow2.asm -> asm-tree 9.5
- org.ow2.asm -> asm-analysis 9.5
- com.zaxxer -> HikariCP 5.1.0
- org.ow2.asm -> asm 9.6
- org.ow2.asm -> asm-commons 9.6
- org.ow2.asm -> asm-util 9.6
- org.ow2.asm -> asm-tree 9.6
- org.ow2.asm -> asm-analysis 9.6
- cglib -> cglib 3.3.0
- com.google.code.gson -> gson 2.10.1
- com.jamonapi -> jamon 2.82
- com.ning -> async-http-client 1.9.40
- commons-beanutils 1.9.4
- commons-codec 1.15
- org.apache.commons -> commons-email 1.5
- commons-codec 1.16.1
- org.apache.commons -> commons-email 1.6.0
- commons-fileupload 1.5
- commons-io 2.11.0
- commons-io 2.15.1
- com.google.code.maven-play-plugin.org.apache.commons -> commons-javaflow 1590792
- org.apache.commons -> commons-lang3 3.12.0
- org.apache.commons -> commons-text 1.10.0
- commons-logging 1.2
- org.apache.commons -> commons-lang3 3.14.0
- org.apache.commons -> commons-text 1.11.0
- commons-logging 1.3.0
- org.dom4j -> dom4j 2.1.4
- com.h2database -> h2 1.4.200
- javax.activation -> javax.activation-api 1.2.0
- com.sun.mail -> javax.mail 1.6.2
- javax.inject 1.0
- javax.validation -> validation-api 1.1.0.Final
- jaxen 2.0.0
- joda-time 2.12.5
- joda-time 2.12.7
- org.hamcrest -> hamcrest-all 1.3
- junit 4.13.2
- jregex 1.2_01
- log4j-api 2.20.0
- log4j-core 2.20.0
- org.apache.logging.log4j -> log4j-api 2.23.0
- org.apache.logging.log4j -> log4j-core 2.23.0
- net.sf.ehcache -> ehcache 2.10.9.2
- net.sf.ezmorph -> ezmorph 1.0.6
- net.sf.jsr107cache -> jsr107cache 1.1
- net.sf.oval -> oval 1.90
- com.mysql -> mysql-connector-j 8.0.33
- com.mysql -> mysql-connector-j 8.3.0
- oauth.signpost -> signpost-core 1.2.1.2
- org.apache.geronimo.specs -> geronimo-servlet_2.5_spec 1.2
- org.apache.ivy -> ivy 2.5.1
- org.bouncycastle -> bcprov-jdk18on 1.73
- org.bouncycastle -> bcpkix-jdk18on 1.73
- org.codehaus.groovy -> groovy 3.0.17
- org.codehaus.groovy -> groovy-xml 3.0.17
- org.apache.ivy -> ivy 2.5.2
- org.bouncycastle -> bcprov-jdk18on 1.77
- org.bouncycastle -> bcpkix-jdk18on 1.77
- org.codehaus.groovy -> groovy 3.0.20
- org.codehaus.groovy -> groovy-xml 3.0.20
- org.eclipse.jdt -> org.eclipse.jdt.core 3.33.0
- org.eclipse.jdt -> ecj 3.33.0
- org.hibernate -> hibernate-core 5.6.5.Final.patched
- net.bytebuddy -> byte-buddy 1.14.4
- net.bytebuddy -> byte-buddy 1.14.12
- javax.persistence -> javax.persistence-api 2.2
- org.hibernate.common -> hibernate-commons-annotations 5.1.2.Final
- org.hibernate -> hibernate-validator 5.4.3.Final
- io.smallrye -> jandex 3.1.1
- org.jboss.logging -> jboss-logging 3.5.0.Final
- io.smallrye -> jandex 3.1.6
- org.jboss.logging -> jboss-logging 3.5.3.Final
- org.jboss.spec.javax.transaction -> jboss-transaction-api_1.2_spec 1.1.1.Final
- javax.xml.bind -> jaxb-api 2.3.1
- org.glassfish.jaxb -> jaxb-runtime 2.3.8
- com.fasterxml -> classmate 1.5.1
- org.glassfish.jaxb -> jaxb-runtime 2.3.9
- com.fasterxml -> classmate 1.7.0
- org.hibernate -> hibernate-c3p0 5.6.15.Final
- org.hibernate -> hibernate-ehcache 5.6.15.Final
- com.mchange -> mchange-commons-java 0.2.20
- org.javassist -> javassist 3.29.2-GA
- org.javassist -> javassist 3.30.2-GA
- io.netty -> netty 3.10.6.Final
- org.postgresql -> postgresql 42.6.0
- org.slf4j -> slf4j-api 2.0.7
- org.apache.logging.log4j -> log4j-slf4j2-impl 2.20.0
- org.yaml -> snakeyaml 2.0
- org.postgresql -> postgresql 42.7.2
- org.slf4j -> slf4j-api 2.0.12
- org.apache.logging.log4j -> log4j-slf4j2-impl 2.23.0
- org.yaml -> snakeyaml 2.2
- net.spy -> spymemcached 2.12.3
- com.thoughtworks.xstream -> xstream 1.4.20
- xmlpull 1.1.3.4d_b4_min
Expand Down
Binary file removed framework/lib/HikariCP-5.0.1.jar
Binary file not shown.
Binary file added framework/lib/HikariCP-5.1.0.jar
Binary file not shown.
Binary file removed framework/lib/asm-9.5.jar
Binary file not shown.
Binary file added framework/lib/asm-9.6.jar
Binary file not shown.
Binary file removed framework/lib/asm-analysis-9.5.jar
Binary file not shown.
Binary file added framework/lib/asm-analysis-9.6.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed framework/lib/classmate-1.5.1.jar
Binary file not shown.
Binary file added framework/lib/classmate-1.7.0.jar
Binary file not shown.
Binary file removed framework/lib/commons-codec-1.15.jar
Binary file not shown.
Binary file added framework/lib/commons-codec-1.16.1.jar
Binary file not shown.
Binary file removed framework/lib/commons-email-1.5.jar
Binary file not shown.
Binary file added framework/lib/commons-email-1.6.0.jar
Binary file not shown.
Binary file removed framework/lib/commons-io-2.11.0.jar
Binary file not shown.
Binary file added framework/lib/commons-io-2.15.1.jar
Binary file not shown.
Binary file removed framework/lib/commons-lang3-3.12.0.jar
Binary file not shown.
Binary file added framework/lib/commons-lang3-3.14.0.jar
Binary file not shown.
Binary file removed framework/lib/commons-logging-1.2.jar
Binary file not shown.
Binary file added framework/lib/commons-logging-1.3.0.jar
Binary file not shown.
Binary file removed framework/lib/commons-text-1.10.0.jar
Binary file not shown.
Binary file added framework/lib/commons-text-1.11.0.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed framework/lib/jandex-3.1.1.jar
Binary file not shown.
Binary file added framework/lib/jandex-3.1.6.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed framework/lib/jboss-logging-3.5.0.Final.jar
Binary file not shown.
Binary file added framework/lib/jboss-logging-3.5.3.Final.jar
Binary file not shown.
Binary file not shown.
Binary file removed framework/lib/log4j-api-2.20.0.jar
Binary file not shown.
Binary file added framework/lib/log4j-api-2.23.0.jar
Binary file not shown.
Binary file removed framework/lib/log4j-core-2.20.0.jar
Binary file not shown.
Binary file added framework/lib/log4j-core-2.23.0.jar
Binary file not shown.
Binary file removed framework/lib/log4j-slf4j2-impl-2.20.0.jar
Binary file not shown.
Binary file added framework/lib/log4j-slf4j2-impl-2.23.0.jar
Binary file not shown.
Binary file removed framework/lib/mysql-connector-j-8.0.33.jar
Binary file not shown.
Binary file added framework/lib/mysql-connector-j-8.3.0.jar
Binary file not shown.
Binary file removed framework/lib/postgresql-42.6.0.jar
Binary file not shown.
Binary file added framework/lib/postgresql-42.7.2.jar
Binary file not shown.
Binary file added framework/lib/slf4j-api-2.0.12.jar
Binary file not shown.
Binary file removed framework/lib/slf4j-api-2.0.7.jar
Binary file not shown.
Binary file not shown.
39 changes: 28 additions & 11 deletions framework/pym/play/cmdloader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import print_function
import imp
import importlib.util
import importlib.machinery
import os
import warnings
import traceback
Expand All @@ -22,8 +23,9 @@ def load_core(self):
for filename in os.listdir(self.path):
if filename != "__init__.py" and filename.endswith(".py"):
try:
name = filename.replace(".py", "")
mod = load_python_module(name, self.path)
module_name = filename.replace(".py", "")
module_path = os.path.join(self.path, filename)
mod = load_python_module(module_name, module_path)
self._load_cmd_from(mod)
except Exception as e:
print (e)
Expand All @@ -35,7 +37,8 @@ def load_play_module(self, modname):
if os.path.exists(commands):
try:
leafname = os.path.basename(modname).split('.')[0]
mod = imp.load_source(leafname, os.path.join(modname, "commands.py"))
# print(f"Loading commands for module \"{modname}\"")
mod = load_source(leafname, os.path.join(modname, "commands.py"))
self._load_cmd_from(mod)
except Exception as e:
print('~')
Expand All @@ -55,12 +58,26 @@ def _load_cmd_from(self, mod):
if 'MODULE' in dir(mod):
self.modules[mod.MODULE] = mod


def load_python_module(name, location):
mod_desc = imp.find_module(name, [location])
mod_file = mod_desc[0]
try:
return imp.load_module(name, mod_desc[0], mod_desc[1], mod_desc[2])
finally:
if mod_file != None and not mod_file.closed:
mod_file.close()
# print(f"Loading module \"{name}\" at location \"{location}\"")
spec = importlib.util.spec_from_file_location(name, location)
if spec is None:
raise ImportError(f"Could not find module {name} at {location}")

mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)

return mod


# Obtained from https://docs.python.org/dev/whatsnew/3.12.html#imp
def load_source(modname, filename):
loader = importlib.machinery.SourceFileLoader(modname, filename)
spec = importlib.util.spec_from_file_location(modname, filename, loader=loader)
module = importlib.util.module_from_spec(spec)
# The module is always executed and not cached in sys.modules.
# Uncomment the following line to cache the module.
# sys.modules[module.__name__] = module
loader.exec_module(module)
return module
10 changes: 9 additions & 1 deletion framework/pym/play/commands/autotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,20 @@ def autotest(app, args):
opener.open('%s://localhost:%s/@kill' % (protocol, http_port))
except Exception as e:
pass


testCompleted = False
if os.path.exists(os.path.join(app.path, 'test-result/result.passed')):
testCompleted = True
print("~ All tests passed")
print("~")
testspassed = True
if os.path.exists(os.path.join(app.path, 'test-result/result.failed')):
testCompleted = True
print("~ Some tests have failed. See file://%s for results" % test_result)
print("~")
sys.exit(1)

if not testCompleted:
print("~ Tests did not successfully complete.")
print("~")
sys.exit(-1)
24 changes: 16 additions & 8 deletions framework/pym/play/commands/modulesrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import urllib.request, urllib.error, urllib.parse
import shutil
import string
import imp
import importlib.util
import time
import urllib.request, urllib.parse, urllib.error
import yaml
Expand Down Expand Up @@ -40,8 +40,16 @@

def load_module(name):
base = os.path.normpath(os.path.dirname(os.path.realpath(sys.argv[0])))
mod_desc = imp.find_module(name, [os.path.join(base, 'framework/pym')])
return imp.load_module(name, mod_desc[0], mod_desc[1], mod_desc[2])
module_path = os.path.join(base, 'framework/pym', name, '__init__.py')

spec = importlib.util.spec_from_file_location(name, module_path)
if spec is None:
raise ImportError(f"Could not find module \"{name}\" at \"{module_path}\"")

mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)

return mod

json = load_module('simplejson')

Expand Down Expand Up @@ -93,7 +101,7 @@ def __init__(self, width=55):

def retrieve(self, url, destination, callback=None):
self.size = 0
time.clock()
time.perf_counter()
try:
headers={'User-Agent':DEFAULT_USER_AGENT,
'Accept': 'application/json'
Expand All @@ -117,7 +125,7 @@ def retrieve(self, url, destination, callback=None):
return self.size

def chunk_read(self, response, destination, chunk_size=8192, report_hook=None):
total_size = response.info().getheader('Content-Length').strip()
total_size = response.headers['Content-Length'].strip()
total_size = int(total_size)
bytes_so_far = 0
file = open(destination,"wb")
Expand Down Expand Up @@ -154,7 +162,7 @@ def progress(self, bytes_so_far, blocksize, filesize):
done = 100
bar = self.bar(bytes_so_far, filesize, done)
if not self.cycles % 3 and bits != filesize:
now = time.clock()
now = time.perf_counter()
elapsed = now-self.before
if elapsed:
speed = self.kibi(blocksize * 3 // elapsed)
Expand Down Expand Up @@ -320,7 +328,7 @@ def build(app, args, env):
if os.path.exists(deps_file):
f = open(deps_file)
try:
deps = yaml.load(f.read())
deps = yaml.safe_load(f.read())
if 'self' in deps:
splitted = deps["self"].split(" -> ")
if len(splitted) == 2:
Expand All @@ -346,7 +354,7 @@ def build(app, args, env):

if os.path.exists(deps_file):
f = open(deps_file)
deps = yaml.load(f.read())
deps = yaml.safe_load(f.read())
if 'self' in deps:
splitted = deps["self"].split(" -> ")
f.close()
Expand Down
Loading

0 comments on commit 2f02fcd

Please sign in to comment.