Giter Site home page Giter Site logo

create-python-package's People

Contributors

cs01 avatar florimondmanca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

create-python-package's Issues

Pipenv integration

create-python-package creates a virtualenv by default. While I think this is a fair default, more and more people (myself included) made the switch to pipenv to manage dependencies.

I'd love to see a --pipenv option that would run:

pipenv install -e .

for us. After that, we can switch to use pipenv so this wouldn't interfere with the current shortcuts around virtualenvs.

add 'private' option

Add 'private' option prompt and automatically add appropriate classifier to setup.py if private is chosen.

Classifier is

"Private :: Do Not Upload"

Package name with hyphens should be converted to underscores

I've just tried creating a Python package named tartiflette-asgi (:wink:) and the resulting Python package is called tartiflette-asgi. It should be tartiflette_asgi because hyphens aren't allowed in Python identifiers.

To be clear, if name contains hyphens:

  • Keep the hyphenized name to create the project folder, project name, etc
  • Convert hyphens to underscores when creating the package itself. Use a .isidentifier() check to be 100% sure.

FYI, I had to implement a similar thing in Bocadillo CLI; PR is here: bocadilloproject/bocadillo-cli#3

Support continuous integration choice

It would be helpful if CPP allowed the user to select from a list of continuous integration tools.

For example, if travis were chosen, a .travis.yml file would be added, such as

language: python
sudo: required
python:
  - "3.6"
install:
  - pip install .
script:
  - python setup.py tests
cache:
  pip: true

Customizable license

Hey, just tried using this tool to init a new Python package. Very neat. ๐Ÿ‘

Currently, an MIT license is generated, but:

  • Although it's a good sensible default, we may not want to use MIT.
  • The author is not filled in.

There's a great little tool called mklicense which can be used to generate various licenses (with a certain sense of humour).

We could ask the create-python-package user if they're OK to use MIT (and ask for the author's name?) and if not make a subcall to mklicense.

Select test framework

Currently, create-python-package sets up a sample test suite based off unittest. One other popular option (which I personally use) is pytest.

It would be cool if one could select their test framework, e.g. unittest and pytest, or choose to not have tests configured at all.

For pytest, a pytest.ini file should be generated to configure the test paths:

[pytest]
testpaths = tests/

fails on windows

Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32

full console log

python -m pipx run create-python-package     
  create-python-package is already on your PATH and installed at D:\Projects\Tools\Python3\Scripts\create-python-package.EXE. Downloading and running anyway.
Assuming app is 'create-python-package.exe' (Windows only)
Using template https://github.com/cs01/cookiecutter-pypackage5h
You've downloaded C:\Users\[user]\.cookiecutters\cookiecutter-pypackage before. Is it okay to delete and re-download it? [yes]:
full_name [First Last]: zarlo
email [[email protected]]: [email protected]
github_username [GitHubUser]: zarlo
project_name [Python Project]: sandboxre
project_short_description []:
pypi_username [zarlo]:
version [0.1.0]:
Select command_line_interface:
1 - argparse
2 - No command-line interface
Choose from 1, 2 [1]: 2
Select open_source_license:
1 - MIT license
2 - BSD license
3 - ISC license
4 - Apache Software License 2.0
5 - GNU General Public License v3
6 - Not open source
Choose from 1, 2, 3, 4, 5, 6 [1]: 2
Traceback (most recent call last):
  File "C:\Users\[user]\AppData\Local\Temp\tmp4nr5gbg4.py", line 17, in <module>
    remove_file(cli_file)
  File "C:\Users\[user]\AppData\Local\Temp\tmp4nr5gbg4.py", line 9, in remove_file
    os.remove(os.path.join(PROJECT_DIRECTORY, filepath))
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'D:\\Projects\\Github\\zarlo\\sandbox.py\\sandboxre\\sandboxre\\cli.py'
Stopping generation because post_gen_project hook script didn't exit successfully
Traceback (most recent call last):
  File "D:\Projects\Tools\Python3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "D:\Projects\Tools\Python3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\[user]\.local\pipx\.cache\9e1584308bc335a\Scripts\create-python-package.exe\__main__.py", line 7, in <module>
  File "c:\users\[user]\.local\pipx\.cache\9e1584308bc335a\lib\site-packages\createpythonpackage\main.py", line 29, in main
    cookiecutter(args.template)
  File "c:\users\[user]\.local\pipx\.cache\9e1584308bc335a\lib\site-packages\cookiecutter\main.py", line 94, in cookiecutter
    output_dir=output_dir
  File "c:\users\[user]\.local\pipx\.cache\9e1584308bc335a\lib\site-packages\cookiecutter\generate.py", line 376, in generate_files
    delete_project_on_failure
  File "c:\users\[user]\.local\pipx\.cache\9e1584308bc335a\lib\site-packages\cookiecutter\generate.py", line 236, in _run_hook_from_repo_dir
    run_hook(hook_name, project_dir, context)
  File "c:\users\[user]\.local\pipx\.cache\9e1584308bc335a\lib\site-packages\cookiecutter\hooks.py", line 145, in run_hook
    run_script_with_context(script, project_dir, context)
  File "c:\users\[user]\.local\pipx\.cache\9e1584308bc335a\lib\site-packages\cookiecutter\hooks.py", line 129, in run_script_with_context
    run_script(temp.name, cwd)
  File "c:\users\[user]\.local\pipx\.cache\9e1584308bc335a\lib\site-packages\cookiecutter\hooks.py", line 91, in run_script
    'Hook script failed (exit status: {})'.format(exit_status)
cookiecutter.exceptions.FailedHookException: Hook script failed (exit status: 1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.