NSLS-II / scientific-python-cookiecutter

a tutorial and 'cookiecutter' template for a scientific Python library
https://nsls-ii.github.io/scientific-python-cookiecutter/
BSD 3-Clause "New" or "Revised" License
116 stars 41 forks source link

bug in generating README.rst header #77

Closed vstadnytskyi closed 5 years ago

vstadnytskyi commented 5 years ago

I have reported this bug before but I couldn't reproduce it back then. I have gotten it again and I was more careful documenting it.

it manifests as an error

user:dataq_instruments user-13$ twine upload dist/*
Uploading distributions to https://upload.pypi.org/legacy/
Uploading dataq_instruments-0.0.0-py3-none-any.whl
100%|████████████████████████████████████████████████████████████████████████████████████████████| 7.97k/7.97k [00:01<00:00, 4.88kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 400 Client Error: The description failed to render in the default format of reStructuredText. See https://pypi.org/help/#description-content-type for more information. for url: https://upload.pypi.org/legacy/

you can see it here

$ nano README.rst
===============================
Python package for Dataq Instuments
===============================

Reproduction

user:Software user-13$ cookiecutter https://github.com/NSLS-II/scientific-python-cookiecutter
You've downloaded /Users/femto-13/.cookiecutters/scientific-python-cookiecutter before. Is it okay to delete and re-download it? [yes]: yes
full_name [Name or Organization]: user user
email []: email@gmail.com
github_username []: vstadnytskyi
project_name [Your Project Name]: this is my test project name with a very long name, very long
package_dist_name [this-is-my-test-project-name-with-a-very-long-name,-very-long]: test-project
package_dir_name [this_is_my_test_project_name_with_a_very_long_name,_very_long]: test_project
repo_name [this-is-my-test-project-name-with-a-very-long-name,-very-long]: test-project
project_short_description [Python package for doing science.]: my test project name with a very long name, very long   
year [2019]: 2015
Select minimum_supported_python_version:
1 - 3.6
2 - 3.7
3 - 3.5
4 - 3.4
Choose from 1, 2, 3, 4 (1, 2, 3, 4) [1]: 1

The README.rst file has header that is not complete

$ nano README.rst
===============================
this is my test project name with a very long name, very long
===============================

.. image:: https://img.shields.io/travis/vstadnytskyi/test-project.svg
        :target: https://travis-ci.org/vstadnytskyi/test-project

.. image:: https://img.shields.io/pypi/v/test-project.svg
        :target: https://pypi.python.org/pypi/test-project

my test project name with a very long name, very long

* Free software: 3-clause BSD license
* Documentation: (COMING SOON!) https://vstadnytskyi.github.io/test-project.

Features
--------

* TODO

In both example I see 31 "=" characters in the header. So if the description too long you will get an error in the twine uploading step

vstadnytskyi commented 5 years ago

I might be wrong but don't we take this file as a template and substitute the project name typed in the terminal in the placeholder?

scientific-python-cookiecutter/{{ cookiecutter.repo_name }}/README.rst

the snippet of the code below has exactly 31 "=" characters.

===============================
{{ cookiecutter.project_name }}
===============================
mrakitin commented 5 years ago

Right. See the fix in #78.