-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify Project Structure with bare minimum requirements
Links to Protean 0.5.0
- Loading branch information
Showing
20 changed files
with
282 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,13 @@ Notes: | |
|
||
This template chooses some project implementations to be available default: | ||
|
||
* Pytest_ for testing the business logic | ||
* Pytest_ as the Test Framework | ||
* bumpversion_ for maintaining a semantic version | ||
|
||
Requirements | ||
------------ | ||
|
||
Projects using this template have these minimal dependencies: | ||
Projects using this template have these dependencies: | ||
|
||
* Cookiecutter_ - just for creating the project | ||
* Setuptools_ - for building the package, wheels etc. Setuptools is now packaged by default with most Python Virtual environment managers. | ||
|
@@ -112,30 +112,13 @@ You will be asked for these fields: | |
"0.1.0" | ||
- Release version (see ``.bumpversion.cfg``). | ||
|
||
* - ``command_line_interface`` | ||
- .. code:: python | ||
|
||
"plain" | ||
- Option to enable a CLI (a bin/executable file). Available options: | ||
|
||
* ``plain`` - a very simple command. | ||
* ``argparse`` - a command implemented with ``argparse``. | ||
* ``click`` - a command implemented with `click <http://click.pocoo.org/>`_ - which you can use to build more complex commands. | ||
* ``no`` - no CLI at all. | ||
|
||
* - ``command_line_interface_bin_name`` | ||
- .. code:: python | ||
|
||
"domain" | ||
- Name of the CLI bin/executable file (set the console script name in ``setup.py``). | ||
|
||
After this you can create the initial repository (make sure you `create <https://github.com/new>`_ an *empty* Github | ||
project):: | ||
|
||
git init . | ||
git add . | ||
git commit -m "Initial skel." | ||
git remote add origin [email protected]:subhashb/python-domain.git | ||
git commit -m "Initial commit" | ||
git remote add origin [email protected]:<username>/<repo_name>.git | ||
git push -u origin master | ||
|
||
Developing the project | ||
|
@@ -145,10 +128,6 @@ To run all the tests, just run:: | |
|
||
pytest | ||
|
||
Releasing the project | ||
````````````````````` | ||
Before releasing your package on PyPI you should have all the tox environments passing. | ||
|
||
Version management | ||
'''''''''''''''''' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
{ | ||
"full_name": "Subhash Bhushan C", | ||
"email": "subhash.bhushan@gmail.com", | ||
"website": "https://proteanhq.com", | ||
"github_username": "subhashb", | ||
"project_name": "Domain", | ||
"repo_name": "protean-{{ cookiecutter.project_name|lower|replace(' ','-') }}", | ||
"full_name": "John Doe", | ||
"email": "john.doe.12345@gmail.com", | ||
"website": "https://johndoe12345.com", | ||
"github_username": "johndoe", | ||
"project_name": "New Project", | ||
"repo_name": "{{ cookiecutter.project_name|lower|replace(' ','-') }}", | ||
"package_name": "{{ cookiecutter.project_name|lower|replace(' ','_')|replace('-','_') }}", | ||
"distribution_name": "{{ cookiecutter.package_name|replace('_','-') }}", | ||
"project_short_description": "A basic Protean Application package. Generated with cookiecutter-protean.", | ||
"version": "0.0.1", | ||
"command_line_interface": [ | ||
"plain", | ||
"argparse", | ||
"click", | ||
"no" | ||
], | ||
"command_line_interface_bin_name": "{{ cookiecutter.distribution_name }}" | ||
} | ||
"project_short_description": "{{ cookiecutter.project_name }} - A basic Protean Application, generated with cookiecutter-protean.", | ||
"version": "0.0.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
[flake8] | ||
max-line-length = 199 | ||
exclude = tests/*.py | ||
max-line-length = 119 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,78 @@ | ||
#!/usr/bin/env python | ||
# -*- encoding: utf-8 -*- | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
|
||
import io | ||
import re | ||
from __future__ import absolute_import, print_function | ||
|
||
import io, re | ||
from glob import glob | ||
from os.path import basename | ||
from os.path import dirname | ||
from os.path import join | ||
from os.path import splitext | ||
from os.path import basename, dirname, join, splitext | ||
|
||
from setuptools import find_packages | ||
from setuptools import setup | ||
# ThirdParty Library Imports | ||
from setuptools import find_packages, setup | ||
|
||
|
||
def read(*names, **kwargs): | ||
with io.open( | ||
join(dirname(__file__), *names), | ||
encoding=kwargs.get('encoding', 'utf8') | ||
join(dirname(__file__), *names), encoding=kwargs.get("encoding", "utf8") | ||
) as fh: | ||
return fh.read() | ||
|
||
|
||
testing_requires = [ | ||
"flake8-commas==2.0.0", | ||
"future==0.18.2", | ||
"mock==4.0.2", | ||
"pytest-bdd==3.2.1", | ||
"pytest-cov==2.8.1", | ||
"pytest-flake8==1.0.4", | ||
"pytest-flask==0.15.1", | ||
"pytest-freezegun==0.4.1", | ||
"pytest-mock==2.0.0", | ||
"pytest==5.2.1", | ||
] | ||
|
||
dev_requires = testing_requires + [ | ||
"bump2version==1.0.0", | ||
] | ||
|
||
setup( | ||
name='{{ cookiecutter.distribution_name }}', | ||
version='{{ cookiecutter.version }}', | ||
description={{ '{0!r}'.format(cookiecutter.project_short_description).lstrip('ub') }}, | ||
long_description='%s\n%s' % ( | ||
re.compile('^.. start-badges.*^.. end-badges', re.M | re.S).sub('', read('README.rst')), | ||
re.sub(':[a-z]+:`~?(.*?)`', r'``\1``', read('CHANGELOG.rst')) | ||
name="{{ cookiecutter.distribution_name }}", | ||
version="{{ cookiecutter.version }}", | ||
description={{"{0!r}".format(cookiecutter.project_short_description).lstrip("ub")}}, | ||
long_description="%s\n%s" | ||
% ( | ||
re.compile("^.. start-badges.*^.. end-badges", re.M | re.S).sub( | ||
"", read("README.rst") | ||
), | ||
re.sub(":[a-z]+:`~?(.*?)`", r"``\1``", read("CHANGELOG.rst")), | ||
), | ||
author={{ '{0!r}'.format(cookiecutter.full_name).lstrip('ub') }}, | ||
author_email={{ '{0!r}'.format(cookiecutter.email).lstrip('ub') }}, | ||
url='https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}', | ||
packages=find_packages('src'), | ||
package_dir={'': 'src'}, | ||
py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')], | ||
author={{"{0!r}".format(cookiecutter.full_name).lstrip("ub")}}, | ||
author_email={{"{0!r}".format(cookiecutter.email).lstrip("ub")}}, | ||
url="https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}", | ||
packages=find_packages("src"), | ||
package_dir={"": "src"}, | ||
py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")], | ||
include_package_data=True, | ||
zip_safe=False, | ||
classifiers=[ | ||
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers | ||
'Development Status :: 3 - Alpha', | ||
'Intended Audience :: Developers', | ||
'Operating System :: Unix', | ||
'Operating System :: POSIX', | ||
'Operating System :: Microsoft :: Windows', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3 :: Only', | ||
'Topic :: Utilities', | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3 :: Only", | ||
], | ||
project_urls={ | ||
'Issue Tracker': 'https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}/issues', | ||
}, | ||
keywords=[ | ||
# eg: 'keyword1', 'keyword2', 'keyword3', | ||
], | ||
python_requires='>=3.6', | ||
python_requires=">=3.7", | ||
install_requires=[ | ||
'protean==0.0.10', | ||
{%- if cookiecutter.command_line_interface == 'click' %} | ||
'click', | ||
{%- endif %} | ||
"protean==0.5.0", | ||
# eg: 'aspectlib==1.1.1', 'six>=1.7', | ||
], | ||
extras_require={ | ||
'dev': ['check-manifest'], | ||
'test': ['coverage'], | ||
}, | ||
{%- if cookiecutter.command_line_interface != 'no' %} | ||
entry_points={ | ||
'console_scripts': [ | ||
'{{ cookiecutter.command_line_interface_bin_name }} = {{ cookiecutter.package_name }}.cli:main', | ||
] | ||
"test": testing_requires, | ||
"tests": testing_requires, | ||
"testing": testing_requires, | ||
"dev": dev_requires, | ||
"all": dev_requires, | ||
}, | ||
{%- endif %} | ||
) |
14 changes: 0 additions & 14 deletions
14
{{cookiecutter.repo_name}}/src/{{cookiecutter.package_name}}/__main__.py
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
{{cookiecutter.repo_name}}/src/{{cookiecutter.package_name}}/cli.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.