Skip to content

Commit

Permalink
requirements.txt and requirements.dev generation based on template
Browse files Browse the repository at this point in the history
choices
Related #2, #3, #4, #5, #6, #10
  • Loading branch information
insspb committed Sep 19, 2019
1 parent 523278b commit 192e640
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 41 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

temp/
tmp/
py3_bp

### Tests ###

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ folder and as `reStructuredText` in `docs` folder.
and `build` folders. Cannot be switched off at this moment.
* `setup.py` and `setup.cfg` generation. Files will work, but some adjustment
required if you want to use them on pypi. Not all planned features included.
* `requirements.txt` and `requirements.dev` generation based on template
choices.
41 changes: 26 additions & 15 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,30 @@
"version": "0.0.1",
"install_github_issues_templates": ["no", "yes"],
"install_gitlab_issues_templates": ["no", "yes"],
"python_27_support": ["no", "yes"],
"python_32_support": ["no", "yes"],
"python_33_support": ["no", "yes"],
"python_34_support": ["no", "yes"],
"python_35_support": ["no", "yes"],
"python_36_support": ["yes", "no"],
"python_37_support": ["yes", "no"],
"python_38_support": ["yes", "no"],
"python_39_support": ["yes", "no"],
"minimum_python_version": [
"3.6",
"2.7",
"3.2",
"3.3",
"3.4",
"3.5",
"3.7",
"3.8"
],
"maximum_python_version": [
"3.8",
"2.7",
"3.2",
"3.3",
"3.4",
"3.5",
"3.6",
"3.7"
],
"linux_support": ["yes", "no"],
"windows_support": ["no", "yes"],
"vcs": ["Gitlab", "Github", "Bitbucket"],
"vcs_username": "developer",
"vcs_username": "insspb",
"license": [
"MIT",
"BSD-3",
Expand All @@ -30,16 +41,16 @@
],
"test_framework": ["pytest", "None"],
"test_engine": ["tox", "nox", "both", "None"],
"use_travis_ci": ["yes", "no"],
"use_travis_ci": ["no", "yes"],
"use_gitlab_ci": ["yes", "no"],
"use_appveyor_ci": ["yes", "no"],
"use_appveyor_ci": ["no", "yes"],
"use_sphinx_documentation": ["yes", "no"],
"readme_format": ["Markdown", "reStructuredText", "None"],
"changelog_format": ["None", "Markdown", "reStructuredText"],
"authors_format": ["None", "Markdown", "reStructuredText"],
"require_sql_alchemy": ["yes", "no"],
"sql_alchemy_database_engine": ["postgres", "mysql", "None"],
"require_alembic": ["yes", "no"],
"require_sql_alchemy": ["no", "yes"],
"sql_alchemy_database_engine": ["None", "postgres", "mysql"],
"require_alembic": ["no", "yes"],
"current_year": "{% now 'utc', '%Y' %}",
"_extensions": ["jinja2_time.TimeExtension"]
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='py3-bp',
version='0.0.2',
version='0.0.3',
description=('Ultimate template for new Python 3 projects'),
long_description=readme,
long_description_content_type='text/markdown',
Expand Down
23 changes: 23 additions & 0 deletions {{cookiecutter.project_slug}}/requirements.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Testing
{% if cookiecutter.test_framework == 'pytest' -%}
pytest
pytest-cov
{% endif -%}
{% if cookiecutter.test_engine == 'tox' or cookiecutter.test_engine == 'both' -%}
tox
{% endif -%}
{% if cookiecutter.test_engine == 'nox' or cookiecutter.test_engine == 'both' -%}
nox
{% endif -%}
{% if cookiecutter.use_sphinx_documentation == 'yes' -%}
# Documentation and docs linting
sphinx
sphinx-rtd-theme
doc8
recommonmark
{% endif -%}

# Code linting
flake8

-r requirements.txt
12 changes: 12 additions & 0 deletions {{cookiecutter.project_slug}}/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% if cookiecutter.require_sql_alchemy == 'yes' -%}
SQLAlchemy
{% endif -%}
{% if cookiecutter.sql_alchemy_database_engine == 'postgres' -%}
psycopg2
{% endif -%}
{% if cookiecutter.sql_alchemy_database_engine == 'mysql' -%}
pymysql
{% endif -%}
{% if cookiecutter.require_alembic == 'yes' -%}
alembic
{% endif -%}
43 changes: 18 additions & 25 deletions {{cookiecutter.project_slug}}/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@
{%- endif %}
author='{{cookiecutter.author}}',
author_email='{{cookiecutter.author_email}}',
url='https://github.com/insspb/py3-bp',
{%- if cookiecutter.vcs == 'Gitlab' %}
url='https://gitlab.com/{{cookiecutter.vcs_username}}/{{cookiecutter.project_slug}}',
{%- elif cookiecutter.vcs == 'Github' %}
url='https://github.com/{{cookiecutter.vcs_username}}/{{cookiecutter.project_slug}}',
{%- elif cookiecutter.vcs == 'Bitbucket' %}
url='https://bitbucket.org/{{cookiecutter.vcs_username}}/{{cookiecutter.project_slug}}',
{%- endif %}
include_package_data=True,
python_requires='>=3.5',

python_requires='>={{cookiecutter.minimum_python_version}}, <={{cookiecutter.maximum_python_version}}',
install_requires=[
'cookiecutter'
],
{%- if cookiecutter.license == 'Apache Software License 2.0' %}
license='Apache Software License 2.0',
Expand Down Expand Up @@ -64,53 +70,40 @@
{%- endif %}
'Natural Language :: English',
'Programming Language :: Python',
{% if cookiecutter.python_27_support == 'yes' -%}
{% if cookiecutter.minimum_python_version |float <= 2.7 < cookiecutter.maximum_python_version |float -%}
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
{% endif -%}
'Programming Language :: Python :: 3',
{% if cookiecutter.python_32_support == 'yes' -%}
{% if cookiecutter.minimum_python_version |float <= 3.2 <= cookiecutter.maximum_python_version |float -%}
'Programming Language :: Python :: 3.2',
{% endif -%}
{% if cookiecutter.python_33_support == 'yes' -%}
{% if cookiecutter.minimum_python_version |float <= 3.3 <= cookiecutter.maximum_python_version |float -%}
'Programming Language :: Python :: 3.3',
{% endif -%}
{% if cookiecutter.python_34_support == 'yes' -%}
{% if cookiecutter.minimum_python_version |float <= 3.4 <= cookiecutter.maximum_python_version |float -%}
'Programming Language :: Python :: 3.4',
{% endif -%}
{% if cookiecutter.python_35_support == 'yes' -%}
{% if cookiecutter.minimum_python_version |float <= 3.5 <= cookiecutter.maximum_python_version |float -%}
'Programming Language :: Python :: 3.5',
{% endif -%}
{% if cookiecutter.python_36_support == 'yes' -%}
{% if cookiecutter.minimum_python_version |float <= 3.6 <= cookiecutter.maximum_python_version |float -%}
'Programming Language :: Python :: 3.6',
{% endif -%}
{% if cookiecutter.python_37_support == 'yes' -%}
{% if cookiecutter.minimum_python_version |float <= 3.6 <= cookiecutter.maximum_python_version |float -%}
'Programming Language :: Python :: 3.7',
{% endif -%}
{% if cookiecutter.python_38_support == 'yes' -%}
{% if cookiecutter.minimum_python_version |float <= 3.8 <= cookiecutter.maximum_python_version |float -%}
'Programming Language :: Python :: 3.8',
{% endif -%}
{% if cookiecutter.python_39_support == 'yes' -%}
'Programming Language :: Python :: 3.9',
{% endif -%}
'Topic :: Software Development',
'Topic :: Utilities'
'Topic :: Utilities',
],
platforms=[
'Any'
],
keywords=(
'cookiecutter',
'python',
'python3',
'boilerplate',
'boilerplate-template',
'template',
'skeleton',
'scaffolding',
'scaffoldings',
'scaffolding-framework',
'skeleton-template',
'skeleton-application',
),
)

0 comments on commit 192e640

Please sign in to comment.