Commit 0054706a by Owo Sugiana

Gunakan register() ketimbang ZopeTransactionExtension()

1 parent 7c3c0421
0.1.5 2020-04-01
----------------
- Mengganti ZopeTransactionExtension() dengan register().
- Tidak perlu lagi setup.py develop-use-pip. Sebagai gantinya gunakan pip
install -e .
0.1.4 2019-02-01 0.1.4 2019-02-01
---------------- ----------------
- Versi otomatis sesuai CHANGES.txt. - Versi otomatis sesuai CHANGES.txt.
......
...@@ -15,7 +15,7 @@ Upgrade packaging tools:: ...@@ -15,7 +15,7 @@ Upgrade packaging tools::
Install required package:: Install required package::
$ ../env/bin/python setup.py develop-use-pip $ ../env/bin/pip install -e .
Copy configuration file:: Copy configuration file::
......
...@@ -32,12 +32,9 @@ requires = [ ...@@ -32,12 +32,9 @@ requires = [
'deform', 'deform',
'pyramid_beaker', 'pyramid_beaker',
'pyramid_mailer', 'pyramid_mailer',
# 'opensipkd-jsonrpc @ git+https://git.opensipkd.com/sugiana/opensipkd-jsonrpc',
] ]
customs_require = [
# 'http://vpn.opensipkd.com/2019/01/opensipkd-jsonrpc-0.1.tgz',
]
tests_require = [ tests_require = [
'WebTest >= 1.3.1', # py3 compat 'WebTest >= 1.3.1', # py3 compat
'pytest', 'pytest',
...@@ -45,38 +42,6 @@ tests_require = [ ...@@ -45,38 +42,6 @@ tests_require = [
] ]
def run(cmd):
if subprocess.call(cmd) != 0:
sys.exit()
def pip_install(package, upgrade=False):
cmd = [pip, 'install']
if upgrade:
cmd += ['--upgrade']
if sys.argv[2:]:
option = sys.argv[2] # Bisa untuk proxy
cmd += [option]
cmd += [package]
run(cmd)
if sys.argv[1:] and sys.argv[1] == 'develop-use-pip':
bin_ = os.path.split(sys.executable)[0]
pip = os.path.join(bin_, 'pip')
pip_install('pip', True)
pip_install('setuptools', True)
requires_ = requires + customs_require
for package in requires_:
if sys.argv[2:]:
cmd = [pip, 'install', sys.argv[2], package]
else:
cmd = [pip, 'install', package]
run(cmd)
cmd = [sys.executable, sys.argv[0], 'develop']
subprocess.call(cmd)
sys.exit()
setup( setup(
name='web_starter', name='web_starter',
version=version, version=version,
......
...@@ -3,11 +3,13 @@ from sqlalchemy.orm import ( ...@@ -3,11 +3,13 @@ from sqlalchemy.orm import (
scoped_session, scoped_session,
) )
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.declarative import declarative_base
from zope.sqlalchemy import ZopeTransactionExtension import zope.sqlalchemy
DBSession = scoped_session( session_factory = sessionmaker()
sessionmaker(extension=ZopeTransactionExtension())) DBSession = scoped_session(session_factory)
zope.sqlalchemy.register(DBSession)
Base = declarative_base() Base = declarative_base()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!