From eccb4e7d2571565e51e9d9b2e0f85857769887ad Mon Sep 17 00:00:00 2001 From: Xavier Bustamante Talavera Date: Thu, 21 Jun 2018 17:39:40 +0200 Subject: [PATCH] Fix installation issues --- MANIFEST.in | 1 + README.md | 15 +++++++++++---- ereuse_devicehub/config.py | 2 +- setup.cfg | 2 ++ setup.py | 10 +++++++--- 5 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 MANIFEST.in create mode 100644 setup.cfg diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..0c3c1dec --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +recursive-include ereuse_devicehub/dummy/files *.yaml \ No newline at end of file diff --git a/README.md b/README.md index bf8bad44..fcbd2c46 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ The requirements are: - Python 3.5 or higher. - PostgreSQL 9.6 or higher. +- passlib. In debian is ``apt install python3-passlib``. Install Devicehub with *pip*: `pip3 install ereuse-devicehub -U --pre`. @@ -38,10 +39,15 @@ class MyConfig(DevicehubConfig): app = Devicehub(MyConfig()) ``` -Create a PostgreSQL database called *dh-db1*: +Create a PostgreSQL database called *devicehub*: -- In Ubuntu: `# postgres -i` and then `createdb dh-db1`. -- In Debian: `$ createdb dh-db1` +```bash +# su - postgres +postgres $ createdb devicehub +postgres $ psql devicehub +postgres $ GRANT ALL PRIVILEGES ON DATABASE devicehub TO dhub; +postgres $ \q +``` Create the tables in the database by executing in the same directory where `app.py` is: @@ -63,4 +69,5 @@ for more info. Devicehub has many commands that allows you to administrate it. You can, for example, create a dummy database of devices with ``flask dummy`` or create users with ``flask create-user``. See all the -available commands by just executing ``flask``. \ No newline at end of file +available commands by just executing ``flask`` and get more information +per command by executing ``flask command --help``. \ No newline at end of file diff --git a/ereuse_devicehub/config.py b/ereuse_devicehub/config.py index c6dce475..98f9cb93 100644 --- a/ereuse_devicehub/config.py +++ b/ereuse_devicehub/config.py @@ -30,7 +30,7 @@ class DevicehubConfig(Config): BenchmarkProcessorSysbenchDef, BenchmarkRamSysbenchDef } PASSWORD_SCHEMES = {'pbkdf2_sha256'} # type: Set[str] - SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/dh-db1' # type: str + SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/devicehub' # type: str MIN_WORKBENCH = StrictVersion('11.0') # type: StrictVersion """ The minimum algorithm_version of eReuse.org Workbench that this Devicehub diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..224a7795 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[metadata] +description-file = README.md \ No newline at end of file diff --git a/setup.py b/setup.py index 7fd7ac1a..4c37d65e 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import find_packages, setup setup( name="ereuse-devicehub", - version='0.2.0a4', + version='0.2.0a5', packages=find_packages(), url='https://github.com/ereuse/devicehub-teal', license='Affero', @@ -15,12 +15,16 @@ setup( 'marshmallow_enum', 'ereuse-utils [Naming]>=0.3.0b2', 'psycopg2-binary', - 'sqlalchemy-utils', 'requests', 'requests-toolbelt', 'hashids', 'tqdm', - 'click-spinner' + 'click-spinner', + 'sqlalchemy-utils', + 'sqlalchemy-utils [password]', + 'sqlalchemy-utils [color]', + 'sqlalchemy-utils [babel]', + 'PyYAML' ], tests_requires=[ 'pytest',