diff --git a/.gitignore b/.gitignore index 1017f3aee..b84b4aece 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ Thumbs.db .DS_Store pyDAL.egg-info/* +venv/* +test-venv/* dist/* build/* .project diff --git a/CHANGES b/CHANGES index fe38fa5e4..496d957f4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,6 @@ pyDAL changelog =============== - +TEST2 Version 18.0 Released on December 27th 2019 diff --git a/README.md b/README.md index 32ede4c71..d98ec6bf6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# pyDAL +# pyDAL test 3 [![pip version](https://img.shields.io/pypi/v/pydal.svg?style=flat-square)](https://pypi.python.org/pypi/pydal) [![master-test](https://github.com/web2py/pydal/actions/workflows/run_test.yaml/badge.svg)](https://github.com/web2py/pydal/actions/workflows/run_test.yaml) @@ -12,7 +12,7 @@ What makes pyDAL different from most of the other DALs is the syntax: it maps re Historically pyDAL comes from the original web2py's DAL, with the aim of being compatible with any Python program. However, pyDAL nowadays is an indipendent package that can be used in any Python 3.7+ context. -## Installation +## Installation test You can install pyDAL using `pip`: diff --git a/appveyor.yml b/appveyor.yml index 6ef96a0ab..a85027f17 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,30 +5,12 @@ services: environment: matrix: - - PYTHON: "C:/Python27" - PY_VER: "2.7" - adapter: "mssql" - - PYTHON: "C:/Python27" - PY_VER: "2.7" - adapter: "mssqln" - - PYTHON: "C:/Python34" - PY_VER: "3.4" - adapter: "mssql" - - PYTHON: "C:/Python34" - PY_VER: "3.4" - adapter: "mssqln" - - PYTHON: "C:/Python35" - PY_VER: "3.5" - adapter: "mssql" - - PYTHON: "C:/Python35" - PY_VER: "3.5" - adapter: "mssqln" - - PYTHON: "C:/Python36-x64" - PY_VER: "3.6" + - PYTHON: "C:/Python38-x64" + PY_VER: "3.8" PYTHON_ARCH: "64" adapter: "mssql" - - PYTHON: "C:/Python36-x64" - PY_VER: "3.6" + - PYTHON: "C:/Python38-x64" + PY_VER: "3.8" PYTHON_ARCH: "64" adapter: "mssqln" @@ -39,7 +21,7 @@ init: - set PATH=%PYTHON%;%PYTHON%\Scripts;%PATH% install: - - appveyor DownloadFile https://bootstrap.pypa.io/pip/%PY_VER%/get-pip.py + - appveyor DownloadFile https://bootstrap.pypa.io/pip/get-pip.py - python get-pip.py - pip install tox==1.9.2 - pip install codecov diff --git a/pydal/base.py b/pydal/base.py index 21215c6e9..b64d01be6 100644 --- a/pydal/base.py +++ b/pydal/base.py @@ -188,7 +188,7 @@ ) ) - +# TESTING class MetaDAL(type): def __call__(cls, *args, **kwargs): #: intercept arguments for DAL customisation on call diff --git a/pydal/restapi.py b/pydal/restapi.py index 4f954c4bc..97532afd8 100644 --- a/pydal/restapi.py +++ b/pydal/restapi.py @@ -1,10 +1,10 @@ import collections import copy -import datetime import fnmatch import functools import re import traceback +from .utils import utcnow __version__ = "0.1" @@ -67,7 +67,7 @@ def wrapper(*args, **kwargs): data["message"] = str(e) data["code"] = 400 finally: - data["timestamp"] = datetime.datetime.utcnow().isoformat() + data["timestamp"] = utcnow().isoformat() data["api_version"] = __version__ return data diff --git a/pydal/tools/scheduler.py b/pydal/tools/scheduler.py index 3ec119c38..03c2486ea 100644 --- a/pydal/tools/scheduler.py +++ b/pydal/tools/scheduler.py @@ -18,11 +18,12 @@ from pydal import DAL, Field from pydal.validators import IS_IN_SET +from utils import utcnow def now(): """Returns the current datetime in UTC""" - return datetime.datetime.utcnow() + return utcnow() def delta(t_secs): diff --git a/pydal/utils.py b/pydal/utils.py index 6bf5a1b98..6697e77d3 100644 --- a/pydal/utils.py +++ b/pydal/utils.py @@ -11,7 +11,7 @@ import re import warnings - +import datetime class RemovedInNextVersionWarning(DeprecationWarning): pass @@ -19,6 +19,9 @@ class RemovedInNextVersionWarning(DeprecationWarning): warnings.simplefilter("always", RemovedInNextVersionWarning) +def utcnow(): + """returns the current time in utc""" + return datetime.datetime.now(datetime.timezone.utc) def warn_of_deprecation(old_name, new_name, prefix=None, stack=2): msg = "%(old)s is deprecated, use %(new)s instead." diff --git a/tox.ini b/tox.ini index 8350e3c8f..bc4209224 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,6 @@ [tox] -envlist = {py27,pypy,pypy3,py33,py34,py35,py36}-{sqlite,mongo,mysql,oracle}, {py27,py33,py34}-{postgres,postgres3}, py27-{google,mssql} +envlist = {py38,py310}-{sqlite,mongo,mysql,oracle}, {py38,py310}-{postgres,postgres3}, {py38,py310}-{google,mssql} +skipsdist = True [testenv] passenv = ORACLE_HOME ORACLE_BASE LD_LIBRARY_PATH NLS_LANG ORACLE_SID @@ -24,7 +25,7 @@ deps = coverage: coverage oracle: cx_Oracle commands = - py27,pypy,pypy3,py33,py34,py35,py36: {envpython} -m unittest -v -f tests + py38,py10: {envpython} -m unittest -v -f tests coverage: coverage erase coverage: coverage run -m unittest -v -f tests coverage: coverage combine