Skip to content

Commit

Permalink
rename package
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Jan 27, 2021
1 parent 73f5038 commit c8f10ce
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 31 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:/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:/wq/wq.start/stargazers)
[![GitHub Forks](https://img.shields.io/github/forks/wq/wq.start.svg)](https:/wq/wq.start/network)
[![GitHub Issues](https://img.shields.io/github/issues/wq/wq.start.svg)](https:/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:/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:/wq/wq.create/stargazers)
[![GitHub Forks](https://img.shields.io/github/forks/wq/wq.create.svg)](https:/wq/wq.create/network)
[![GitHub Issues](https://img.shields.io/github/issues/wq/wq.create.svg)](https:/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

Expand All @@ -21,7 +21,7 @@
# . venv/bin/activate
python3 -m pip install wq

wq start <projectname> [directory]
wq create <projectname> [directory]
cd <projectname>/db
wq addform ~/my-odk-form.xlsx
```
Expand All @@ -30,7 +30,7 @@ See the [Getting Started] docs for more information.

### Commands

* `wq start <projectname> [directory]`: Create a new Django project from the [wq Django template] and (optionally) the [@wq Create React App template][@wq/cra-template]
* `wq create <projectname> [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)

Expand All @@ -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:/wq/wq-django-template
[@wq/cra-template]: https:/wq/wq.start/tree/master/packages/cra-template
[@wq/cra-template]: https:/wq/wq.create/tree/master/packages/cra-template
[@wq/jquery-mobile]: https:/wq/wq.app/tree/master/packages/jquery-mobile
[xlsform-converter]: https:/wq/xlsform-converter
[Getting Started]: https://wq.io/docs/setup
2 changes: 1 addition & 1 deletion django_project
4 changes: 2 additions & 2 deletions forms.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
"""
Expand Down
33 changes: 27 additions & 6 deletions projects.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from wq.core import wq
from wq.build import wq
import click
import os
import shutil
Expand All @@ -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
Expand All @@ -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()
Expand All @@ -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
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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)
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
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',
],
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit c8f10ce

Please sign in to comment.