From c8f10ce3e4d4be0920dffc02185f8a20fe9f9fc4 Mon Sep 17 00:00:00 2001 From: "S. Andrew Sheppard" Date: Wed, 27 Jan 2021 16:27:47 +0900 Subject: [PATCH] rename package --- README.md | 28 ++++++++++++++-------------- django_project | 2 +- forms.py | 4 ++-- projects.py | 33 +++++++++++++++++++++++++++------ setup.py | 14 +++++++------- version.py | 2 +- 6 files changed, 52 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 9ecdadf..673c031 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -[![wq.start](https://raw.github.com/wq/wq/master/images/256/wq.start.png)](https://wq.io/wq.start) +[![wq.create](https://raw.github.com/wq/wq/master/images/256/wq.create.png)](https://wq.io/wq.create) -[wq.start](https://wq.io/wq.start) provides a simple command-line interface (`wq start`) for starting a new project with the [wq framework], with [wq.app] for the front end and [wq.db] as the backend. wq.start also provides a `wq addform` command that can generate and configure new Django apps from an [XLSForm](http://xlsform.org) definition. +[wq.create](https://wq.io/wq.create) (formerly wq.start) provides a simple command-line interface (`wq create`) for starting a new project with the [wq framework], with [wq.app] for the front end and [wq.db] as the backend. wq.create also provides a `wq addform` command that can generate and configure new Django apps from an [XLSForm](http://xlsform.org) definition. -[![Latest PyPI Release](https://img.shields.io/pypi/v/wq.start.svg)](https://pypi.org/project/wq.start) -[![Release Notes](https://img.shields.io/github/release/wq/wq.start.svg)](https://github.com/wq/wq.start/releases) -[![License](https://img.shields.io/pypi/l/wq.start.svg)](https://wq.io/license) -[![GitHub Stars](https://img.shields.io/github/stars/wq/wq.start.svg)](https://github.com/wq/wq.start/stargazers) -[![GitHub Forks](https://img.shields.io/github/forks/wq/wq.start.svg)](https://github.com/wq/wq.start/network) -[![GitHub Issues](https://img.shields.io/github/issues/wq/wq.start.svg)](https://github.com/wq/wq.start/issues) +[![Latest PyPI Release](https://img.shields.io/pypi/v/wq.create.svg)](https://pypi.org/project/wq.create) +[![Release Notes](https://img.shields.io/github/release/wq/wq.create.svg)](https://github.com/wq/wq.create/releases) +[![License](https://img.shields.io/pypi/l/wq.create.svg)](https://wq.io/license) +[![GitHub Stars](https://img.shields.io/github/stars/wq/wq.create.svg)](https://github.com/wq/wq.create/stargazers) +[![GitHub Forks](https://img.shields.io/github/forks/wq/wq.create.svg)](https://github.com/wq/wq.create/network) +[![GitHub Issues](https://img.shields.io/github/issues/wq/wq.create.svg)](https://github.com/wq/wq.create/issues) -[![Travis Build Status](https://img.shields.io/travis/wq/wq.start/master.svg)](https://travis-ci.org/wq/wq.start) -[![Python Support](https://img.shields.io/pypi/pyversions/wq.start.svg)](https://pypi.org/project/wq.start) -[![Django Support](https://img.shields.io/pypi/djversions/wq.start.svg)](https://pypi.org/project/wq.start) +[![Travis Build Status](https://img.shields.io/travis/wq/wq.create/master.svg)](https://travis-ci.org/wq/wq.create) +[![Python Support](https://img.shields.io/pypi/pyversions/wq.create.svg)](https://pypi.org/project/wq.create) +[![Django Support](https://img.shields.io/pypi/djversions/wq.create.svg)](https://pypi.org/project/wq.create) ### Usage @@ -21,7 +21,7 @@ # . venv/bin/activate python3 -m pip install wq -wq start [directory] +wq create [directory] cd /db wq addform ~/my-odk-form.xlsx ``` @@ -30,7 +30,7 @@ See the [Getting Started] docs for more information. ### Commands - * `wq start [directory]`: Create a new Django project from the [wq Django template] and (optionally) the [@wq Create React App template][@wq/cra-template] + * `wq create [directory]`: Create a new Django project from the [wq Django template] and (optionally) the [@wq Create React App template][@wq/cra-template] * `wq addform ~/my-odk-form.xlsx`: Create a new Django app from the provided XLSForm (uses [xlsform-converter]) * `wq maketemplates`: Create templates for use with [@wq/jquery-mobile][@wq/jquery-mobile] (deprecated) @@ -39,7 +39,7 @@ See the [Getting Started] docs for more information. [wq.app]: https://wq.io/wq.app [wq.db]: https://wq.io/wq.db [wq Django template]: https://github.com/wq/wq-django-template -[@wq/cra-template]: https://github.com/wq/wq.start/tree/master/packages/cra-template +[@wq/cra-template]: https://github.com/wq/wq.create/tree/master/packages/cra-template [@wq/jquery-mobile]: https://github.com/wq/wq.app/tree/master/packages/jquery-mobile [xlsform-converter]: https://github.com/wq/xlsform-converter [Getting Started]: https://wq.io/docs/setup diff --git a/django_project b/django_project index a1309d1..0d757e5 160000 --- a/django_project +++ b/django_project @@ -1 +1 @@ -Subproject commit a1309d174ba7d16f5b47264d8799648935951f4c +Subproject commit 0d757e5731b001fa7cbb07462e2de503c6c96f86 diff --git a/forms.py b/forms.py index 5790437..5df251c 100644 --- a/forms.py +++ b/forms.py @@ -1,4 +1,4 @@ -from wq.core import wq +from wq.build import wq import click import os from xlsconv import parse_xls, xls2django, xls2html, html_context, render @@ -217,7 +217,7 @@ def maketemplates(input_dir, django_dir, template_dir, overwrite): templates/[model_name]_list.html The `wq maketemplates` command is deprecated, and will be removed - in wq.start 2.0, as will all support for @wq/jquery-mobile. The new + in wq.create 2.0, as will all support for @wq/jquery-mobile. The new @wq/react + @wq/material renderer uses React components instead of template strings. """ diff --git a/projects.py b/projects.py index 30872c9..b8e495e 100644 --- a/projects.py +++ b/projects.py @@ -1,4 +1,4 @@ -from wq.core import wq +from wq.build import wq import click import os import shutil @@ -13,7 +13,7 @@ pass -template = resource_filename('wq.start', 'django_project') +template = resource_filename('wq.create', 'django_project') # resource_filename not returning absolute path after pip install if os.sep not in template: import wq as wq_module @@ -26,7 +26,7 @@ def add_arguments(self, parser): parser.add_argument('--domain', help="Web Domain") parser.add_argument('--with-gis', help="Enable GeoDjango") parser.add_argument('--with-npm', help="Enable NPM") - parser.add_argument('--wq-start-version', help="wq start version") + parser.add_argument('--wq-create-version', help="wq create version") @wq.command() @@ -42,8 +42,8 @@ def add_arguments(self, parser): "--with-npm/--without-npm", default=None, help="Enable NPM (& Create React App)" ) -def start(project_name, destination, domain=None, - with_gis=None, with_npm=None): +def create(project_name, destination, domain=None, + with_gis=None, with_npm=None): """ Start a new project with wq.app and wq.db. A new Django project will be created from a wq-specific template. Any options not specified via @@ -102,7 +102,7 @@ def start(project_name, destination, domain=None, template=template, extensions="py,yml,conf,html,sh,js,css,json,xml,gitignore".split(","), domain=domain, - wq_start_version=VERSION, + wq_create_version=VERSION, with_gis=with_gis, with_npm=with_npm, ) @@ -155,3 +155,24 @@ def start(project_name, destination, domain=None, ) click.echo("Run ./deploy.sh 0.0.0 to finish initial setup.") + + +@wq.command() +@click.argument("project_name", required=False) +@click.argument("destination", required=False) +@click.option( + "-d", "--domain", help='Web domain (e.g. example.wq.io)' +) +@click.option( + "--with-gis/--without-gis", default=None, help="Enable GeoDjango" +) +@click.option( + "--with-npm/--without-npm", default=None, + help="Enable NPM (& Create React App)" +) +def start(project_name, destination, domain=None, + with_gis=None, with_npm=None): + """ + (DEPRECATED) Alias for wq create. + """ + create(project_name, destination, domain, with_gis, with_npm) diff --git a/setup.py b/setup.py index 36286ab..6c79514 100644 --- a/setup.py +++ b/setup.py @@ -52,22 +52,22 @@ def list_package_data(root): TEMPLATE_DATA.extend(list_package_data(folder)) setup( - name='wq.start', + name='wq.create', use_scm_version=True, author='S. Andrew Sheppard', author_email='andrew@wq.io', - url='https://wq.io/wq.start', + url='https://wq.io/wq.create', license='MIT', description=LONG_DESCRIPTION.strip(), long_description=readme(), long_description_content_type='text/markdown', - entry_points={'wq': 'wq.start=wq.start'}, - packages=['wq.start'], - package_dir={'wq.start': '.'}, + entry_points={'wq': 'wq.create=wq.create'}, + packages=['wq.create'], + package_dir={'wq.create': '.'}, namespace_packages=['wq'], - package_data={'wq.start': TEMPLATE_DATA}, + package_data={'wq.create': TEMPLATE_DATA}, install_requires=[ - 'wq.core', + 'wq.build', 'psycopg2-binary', 'xlsconv>=1.2.0', ], diff --git a/version.py b/version.py index 5e1a881..95c1c16 100644 --- a/version.py +++ b/version.py @@ -1,5 +1,5 @@ from pkg_resources import get_distribution, DistributionNotFound try: - VERSION = get_distribution("wq.start").version + VERSION = get_distribution("wq.create").version except DistributionNotFound: VERSION = "0.0.0"