Coder Social home page Coder Social logo

nsls-ii / scientific-python-cookiecutter Goto Github PK

View Code? Open in Web Editor NEW
115.0 14.0 41.0 308 KB

a tutorial and 'cookiecutter' template for a scientific Python library

Home Page: https://nsls-ii.github.io/scientific-python-cookiecutter/

License: BSD 3-Clause "New" or "Revised" License

Python 98.33% Makefile 0.68% Batchfile 0.84% Shell 0.14%

scientific-python-cookiecutter's Introduction

Scientific Python Cookiecutter

Documentation

This repository contains a cookiecutter template for generating a scientific Python project complete with CI testing and documentation.

cookiecutter https://github.com/NSLS-II/scientific-python-cookiecutter

Separately, beside the cookiecutter template, it contains tutorial documentation on how to use this template to organize scientific Python code into a package and use popular tools for testing, documentation, and maintenance.

scientific-python-cookiecutter's People

Contributors

abbygi avatar arokem avatar awalter-bnl avatar danielballan avatar dmgav avatar jklynch avatar ktoth17 avatar licode avatar maffettone avatar mikehart85 avatar mpmdean avatar mrakitin avatar sbillinge avatar story645 avatar stuartcampbell avatar tacaswell avatar vstadnytskyi 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

scientific-python-cookiecutter's Issues

migration from Travis to GitHub actions

Did you guys consider migrating from Travis to GitHub Actions? It is one less service to worry about. Or do you think it would be useful to provide instruction on how to set up GitHub Actions instead of Travis-ci?

consider adding section on other CI tools

Is a section on analysis/linting CI tools such as Stickler, Codacy, LGTM, Coveralls, etc. within the scope of this project? It would be great to see some guidance from people in the scientific python community on which of these tools are useful and how to best configure them.

A LGTM employee recently made a pull request to enable it on a project I maintain (pvlib-python) and that sent me down a rabbit hole trying to figure out how to choose among these services.

(Also thanks for this awesome guide.)

Is it save to keep a long key like string in .travis.yml ?

So I have noticed there is a long string saved in .travis.yml. I wonder if that is some kind of key. Is it safe to have it there?

env:
    global:
      # Doctr deploy key for vstadnytskyi/my_package
      - secure: "xJPgTjsUjDmFIKdbk1iM4m/taLo1kxbr+eF1SMeHVn9azWDV/dX6Jjj/tkvp9ZO6+XVyhOF6dL9O0z3WaY

Consider adding sphinx-gallery to the documentation section

Heya - this looks like a cool and useful project! Just wanted to raise awareness of a plugin that makes it easy to create galleries for "examples" folders and the like. It's called Sphinx-Gallery and is what a lot of scientific python projects use for their galleries (e.g. scikit-learn and matplotlib). Let me know if this would be of interest and I can make a PR!

Add .editorconfig.

In particular, this is a good way to specify the preferred line length (79) distinct from the required maximum line length that flake8 will require, which we set to a more generous 115.

error: invalid command 'bdist_wheel', because wheel was not installed

while working on the step Publishing Releases

I got an error (see below for full terminal output)
error: invalid command 'bdist_wheel'

The solution is to install wheel :
pip3 install wheel
this step need to be added to documentation. I propose to update step 9:

Install twine, a tool for uploading packages to PyPI.

python3 -m pip install --upgrade twine

and add an extra word requesting an upgrade of wheel in case It is not installed.

python3 -m pip install --upgrade twine wheel

user:circular_buffer user-13$ python3 -m pip install --upgrade twine
Requirement already up-to-date: twine in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (1.14.0)
Requirement already satisfied, skipping upgrade: readme-renderer>=21.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from twine) (24.0)
Requirement already satisfied, skipping upgrade: tqdm>=4.14 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from twine) (4.35.0)
Requirement already satisfied, skipping upgrade: requests-toolbelt!=0.9.0,>=0.8.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from twine) (0.9.1)
Requirement already satisfied, skipping upgrade: setuptools>=0.7.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from twine) (40.8.0)
Requirement already satisfied, skipping upgrade: pkginfo>=1.4.2 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from twine) (1.5.0.1)
Requirement already satisfied, skipping upgrade: requests!=2.15,!=2.16,>=2.5.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from twine) (2.22.0)
Requirement already satisfied, skipping upgrade: Pygments in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from readme-renderer>=21.0->twine) (2.4.2)
Requirement already satisfied, skipping upgrade: bleach>=2.1.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from readme-renderer>=21.0->twine) (3.1.0)
Requirement already satisfied, skipping upgrade: docutils>=0.13.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from readme-renderer>=21.0->twine) (0.15.2)
Requirement already satisfied, skipping upgrade: six in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from readme-renderer>=21.0->twine) (1.12.0)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine) (2019.9.11)
Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine) (2.8)
Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine) (3.0.4)
Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine) (1.25.3)
Requirement already satisfied, skipping upgrade: webencodings in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from bleach>=2.1.0->readme-renderer>=21.0->twine) (0.5.1)
user:circular_buffer user-13$ python3 setup.py sdist
running sdist
running egg_info
writing py_circular_buffer.egg-info/PKG-INFO
writing dependency_links to py_circular_buffer.egg-info/dependency_links.txt
writing entry points to py_circular_buffer.egg-info/entry_points.txt
writing requirements to py_circular_buffer.egg-info/requires.txt
writing top-level names to py_circular_buffer.egg-info/top_level.txt
reading manifest file 'py_circular_buffer.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
writing manifest file 'py_circular_buffer.egg-info/SOURCES.txt'
running check
creating py_circular_buffer-0.post11.dev0+g5406e31
creating py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer
creating py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer/tests
creating py_circular_buffer-0.post11.dev0+g5406e31/docs
creating py_circular_buffer-0.post11.dev0+g5406e31/docs/source
creating py_circular_buffer-0.post11.dev0+g5406e31/py_circular_buffer.egg-info
copying files to py_circular_buffer-0.post11.dev0+g5406e31...
copying AUTHORS.rst -> py_circular_buffer-0.post11.dev0+g5406e31
copying CONTRIBUTING.rst -> py_circular_buffer-0.post11.dev0+g5406e31
copying LICENSE -> py_circular_buffer-0.post11.dev0+g5406e31
copying MANIFEST.in -> py_circular_buffer-0.post11.dev0+g5406e31
copying README.rst -> py_circular_buffer-0.post11.dev0+g5406e31
copying requirements.txt -> py_circular_buffer-0.post11.dev0+g5406e31
copying setup.cfg -> py_circular_buffer-0.post11.dev0+g5406e31
copying setup.py -> py_circular_buffer-0.post11.dev0+g5406e31
copying versioneer.py -> py_circular_buffer-0.post11.dev0+g5406e31
copying circular_buffer/__init__.py -> py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer
copying circular_buffer/_version.py -> py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer
copying circular_buffer/circular_buffer.py -> py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer
copying circular_buffer/circular_buffer_client.py -> py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer
copying circular_buffer/queue.py -> py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer
copying circular_buffer/refraction.py -> py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer
copying circular_buffer/tests/__init__.py -> py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer/tests
copying circular_buffer/tests/conftest.py -> py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer/tests
copying circular_buffer/tests/oldd_test_examples.py -> py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer/tests
copying circular_buffer/tests/test_circular_buffer.py -> py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer/tests
copying circular_buffer/tests/test_queue.py -> py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer/tests
copying docs/Makefile -> py_circular_buffer-0.post11.dev0+g5406e31/docs
copying docs/make.bat -> py_circular_buffer-0.post11.dev0+g5406e31/docs
copying docs/source/conf.py -> py_circular_buffer-0.post11.dev0+g5406e31/docs/source
copying docs/source/index.rst -> py_circular_buffer-0.post11.dev0+g5406e31/docs/source
copying docs/source/installation.rst -> py_circular_buffer-0.post11.dev0+g5406e31/docs/source
copying docs/source/min_versions.rst -> py_circular_buffer-0.post11.dev0+g5406e31/docs/source
copying docs/source/release-history.rst -> py_circular_buffer-0.post11.dev0+g5406e31/docs/source
copying docs/source/usage.rst -> py_circular_buffer-0.post11.dev0+g5406e31/docs/source
copying py_circular_buffer.egg-info/PKG-INFO -> py_circular_buffer-0.post11.dev0+g5406e31/py_circular_buffer.egg-info
copying py_circular_buffer.egg-info/SOURCES.txt -> py_circular_buffer-0.post11.dev0+g5406e31/py_circular_buffer.egg-info
copying py_circular_buffer.egg-info/dependency_links.txt -> py_circular_buffer-0.post11.dev0+g5406e31/py_circular_buffer.egg-info
copying py_circular_buffer.egg-info/entry_points.txt -> py_circular_buffer-0.post11.dev0+g5406e31/py_circular_buffer.egg-info
copying py_circular_buffer.egg-info/requires.txt -> py_circular_buffer-0.post11.dev0+g5406e31/py_circular_buffer.egg-info
copying py_circular_buffer.egg-info/top_level.txt -> py_circular_buffer-0.post11.dev0+g5406e31/py_circular_buffer.egg-info
Writing py_circular_buffer-0.post11.dev0+g5406e31/setup.cfg
UPDATING py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer/_version.py
set py_circular_buffer-0.post11.dev0+g5406e31/circular_buffer/_version.py to '0.post11.dev0+g5406e31'
Creating tar archive
removing 'py_circular_buffer-0.post11.dev0+g5406e31' (and everything under it)
user:circular_buffer user-13$ python3 setup.py bdist_wheel
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help
error: invalid command 'bdist_wheel'
user:circular_buffer user-13$ 

Typo in ci.html.

Great work! Hopefully I can contribute to this project. For now, I have a very tiny contribution. There is a typo on the page https://nsls-ii.github.io/scientific-python-cookiecutter/ci.html. There is a note at the very end of the page. The link says travis.org which is a Baptist Church instead of travis-ci.org. I have created a pull request that will change the typo.

I have created a pull request but later thought I also should create an issue. What is a better workflow in future? Should I create an issue first, discuss it and then create pull request?

.. note::
    If this repository belongs to a GitHub *organization* (e.g.
    http://github.com/NSLS-II) as opposed to a personal user account
    (e.g. http://github.com/danielballan) you should follow Steps 3-5
    above for the organization's profile at
    ``https://travis-ci.org/profile/YOUR_GITHUB_ORGANIZATION``. It does no
    harm to *also* activate Travis-CI for your personal fork at
    **``https://travis.org/profile``**, but it's more important to activate it for
    the upstream fork associated with the organization

ipython_directive and sphinx_copybutton extensions are broken

I know this isn't this projects responsibility, but since these extensions are included by default I thought I'd point out that neither of these extensions worked for me. I changed my travis environment to install ipython, sphinx, and sphinx_rtd_theme from conda. "sphinx-copybutton" was installed with pip. The ipython directive extension had an import error: ImportError: cannot import name 'Directive' and I noticed it discussed here.

The copybutton extension resulted in has no setup() function; is it really a Sphinx extension module?. Has anyone else run in to these issues?

No issue, just a thank you!

As a scientist who has been struggling to transition to Python from Matlab, this resource is an absolute godsend. Thank you SO MUCH!

Any plans to update the tutorial?

Hi all, I first wanted to say how much I appreciate that you have developed this template. I use it all the time for my python-based projects and was particularly attracted to it in the beginning because of the very extensive and thorough tutorial. I really want to keep using the template going forward especially with the migration from Travis-CI to Github Actions, but I honestly don't even know where to start. In short, I was wondering if there were any plans on updating the tutorial to reflect these new changes?

Thanks again for all your hard work!

no-commit-to-branch main pre-commit hook?

I would love to have this included in the pre-commit hooks, or included as an option.

pre-commit would become in the yaml

  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.4.0
    hooks:
    - id: no-commit-to-branch
      args: ['--branch', 'main']
    - id: check-yaml
    - id: end-of-file-fixer
    - id: trailing-whitespace

Add some documentation on environments.

We currently advise the user:

Verify that you have Python 3.6+. [...] If necessary, install it by your method of choice (apt, Homebrew, conda, etc.).

We are effectively trusting users who already know about environments to manage them themselves, and consigning uninformed users to system Python or standard package managers.

Should we also advise them to do their work in some kind of environment?

I am becoming convinced yes, but I'm not completely sure yet whether we should lead with this --- presenting it as a prerequisite --- or consign it to an appendix. I would be convinced we should lead with it if we can present it succinctly.

Which tool to recommend?

There are many, and it feels like an unstable, or at best only-recently stable, space.

At NSLS-II, we guide users to conda, but this repo is very intentionally more general than NSLS-II or synchrotrons. I hope to attract users and contributors from the scipy community at large, so there will be no mention of deployment details specific to NSLS-II (or of bluesky/databroker).

I think a lighter solution is best, to start. My present thinking is that venv (built-in) and pipenv (well-regarded) are strong candidates. Conda is also worth considering.

This is an opinionated tutorial, aiming to streamline the process for a scientist who might not yet have encountered or appreciated the need for all this tooling, so we should clearly recommend one solution and then at most mention others.

attn @ronpandolfi

Licence makes my project copyright Brookhaven Science Associates

Most files initialised in a cookie-cut project are either generic or are configured by the cookiecutter setup, but the LICENSE file provided reads

Copyright (c) 2015, Brookhaven Science Associates, Brookhaven National Laboratory. All rights reserved.

and also mentions Brookhaven further down. I assume this is an oversight and the LICENSE file was intended to also be a template.

A good option might be to use the author name provided during configuration?

Mention literal-include's value for avoiding copy/pasted examples

This issue is lifting an unaddressed review comment by @mrakitin in #82

I think it's worth to mention that this approach also solves the synchronization issue with the multiple sources of code.

I can't quite figure out how to phrase this succinctly. We have examples in https://github.com/caproto/caproto/blob/master/doc/source/iocs.rst where we link to the source of modules located in the package itself. That'a nice example. Gotta figure how to explain it to a newcomer.

bug in generating README.rst header

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 protected]
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

Add numpy, scipy and pandas to requirements.txt

I think it would be also reasonable to include numpy, scipy and pandas to the requirements.

Also, on Mac when I install matplotlib, it misses PyQT5. That's probably one more package to install by default.

Do we want requests?

Misc Windows problems

I walked my dad through this for his work and we found some issues on Windows:

  • Conda on Windows does not seem to provide a python3 binary. One must type python instead. This would require a lot of "If on Windows..." additions to our documentation. I'm not sure yet how best to handle it. Maybe conda can fix this, but I bet they have a reason for not including it.
  • The instructions for activating a venv environment use the . command which is not available on Windows. (We should probably strongly recommend Windows users use conda anyway.)

where is the ToDo list?

I am the audience you guys made this package. I am a scientist that write a lot of codes but keeps all of them on my server. This project is very helpful for me.

I have seen some projects have ToDo list. However, I don't remember seen anything like that the folder create with Cookiecutter. Does it exist anywhere? Where do people usually put todo lists?

Is it worth encouraging isort?

While linting away unused imports is already done in the pre-commit stage, and in CI, I've had a few projects where the team preferred to also use isort to automatically sort imports.
https://pycqa.github.io/isort/index.html
Are there opinions about this in either direction? Is it worth putting together a brief PR that puts an isort call in the pre-commit? It would behave much like black, and can eventually be added to #105 for CI.

Where do I put examples and refer them from /docs/source/?

I have figured out that you can have examples in the docstring, by adding a line.

.. plot:: examples/numerical_bin_data.py
           :include-source:

This is a very nice way to create good documentation. However, it requires to run a script which creates a figure. I decided to put the script in the /examples/ folder. I put /examples/ into docs/source/examples/. However, It would be nice to have examples in the home directory. It will be easier to find and easier to refer to. Is there a way to put /examples/ in the home directory and refer to them from files down the tree?

Here is the link to documentation generated with a plot build in.

BUG: isort repo is not consistent with latest poetry

it gives this stack dump when trying to install:

$ gcam "test precommit"
[INFO] Installing environment for https://github.com/pycqa/isort.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\simon\\.cache\\pre-commit\\repobucbasvb\\py_env-python3\\Scripts\\python.EXE', '-mpip', 'install', '.')
return code: 1
stdout:
    Processing c:\users\simon\.cache\pre-commit\repobucbasvb
      Installing build dependencies: started
      Installing build dependencies: finished with status 'done'
      Getting requirements to build wheel: started
      Getting requirements to build wheel: finished with status 'done'
      Preparing metadata (pyproject.toml): started
      Preparing metadata (pyproject.toml): finished with status 'error'

stderr:
      error: subprocess-exited-with-error

      Preparing metadata (pyproject.toml) did not run successfully.
      exit code: 1

      [17 lines of output]
      Traceback (most recent call last):
        File "C:\Users\simon\.cache\pre-commit\repobucbasvb\py_env-python3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\simon\.cache\pre-commit\repobucbasvb\py_env-python3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\simon\.cache\pre-commit\repobucbasvb\py_env-python3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\simon\AppData\Local\Temp\pip-build-env-n1eijkm0\overlay\Lib\site-packages\poetry\core\masonry\api.py", line 40, in prepare_metadata_for_build_wheel
          poetry = Factory().create_poetry(Path(".").resolve(), with_groups=False)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\simon\AppData\Local\Temp\pip-build-env-n1eijkm0\overlay\Lib\site-packages\poetry\core\factory.py", line 57, in create_poetry
          raise RuntimeError("The Poetry configuration is invalid:\n" + message)
      RuntimeError: The Poetry configuration is invalid:
        - [extras.pipfile_deprecated_finder.2] 'pip-shims<=0.3.4' does not match '^[a-zA-Z-_.0-9]+$'

      [end of output]

      note: This error originates from a subprocess, and is likely not a problem with pip.
    error: metadata-generation-failed

    Encountered error while generating package metadata.

    See above for output.

    note: This is an issue with the package mentioned above, not pip.
    hint: See above for details.

Check the log at C:\Users\simon\.cache\pre-commit\pre-commit.log

Consistent licensing across NSLS-II and Bluesky projects

@danielballan and I noticed that GitHub doesn't recognize or label most Bluesky projects as having a BSD 3-Clause license, even though they ship with what we consider a BSD 3-Clause license.

This means they don't get a prominent license tag that identifies the license at the top of the project landing page:

image

image

And they also don't get a header providing a quick overview of license features when you view the license file:

image

Note that this project is correctly recognized. Ophyd, for example, is not.

The reason for this are differences in the LICENSE file, deviating from what GitHub recognizes as a standard BSD 3-Clause license. We think this is worth fixing, as there is both legal and social value in using an established and recognizable license with minimal deviations.

Reference for what GitHub recognizes as standard: BSD 3-Clause

The current LICENSE in this repo matches this exactly, changing only the [year] and replacing [fullname] with "Brookhaven National Laboratory".

The current LICENSE in many other NSLS-II and Bluesky repos has the following differences:

  1. Missing explicit BSD 3-Clause License declaration on line 1
  2. Names Brookhaven Science Associates as copyright holder in addition to Brookhaven National Laboratory
  3. Has All rights reserved. on same line as copyright, instead of its own line below it
  4. Uses bullet points instead of numbered list of clauses
  5. Modified Clause 3 to again explicitly name Brookhaven Science Associates, Brookhaven National Laboratory as copyright holder, replacing the default reference: the copyright holder

Points 1, 3 and 4 should be straightforward fixes.

Points 2 and 5 require attention.

Once we have answers to the above, the next steps would be:

  • Update LICENSE in this repo to comply with requirements
  • Ensure updated LICENSE is still recognized by GitHub, fix if not
  • Update LICENSEs in other repos to match this one

struggling with "doctr configure"

Hi All,

It seems there are some changes since I used the cookie cutter last time. I am following the instructions on how to set-up new repository but I am getting this error. I cannot figure out why do I get it. Google did help me.

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/bin/doctr", line 10, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/doctr/__main__.py", line 572, in main
    return process_args(get_parser(config=config))
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/doctr/__main__.py", line 260, in process_args
    return args.func(args, parser)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/doctr/__main__.py", line 497, in configure
    upload_GitHub_deploy_key(deploy_key_repo, public_ssh_key, **login_kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/doctr/local.py", line 312, in upload_GitHub_deploy_key
    return GitHub_post(data, DEPLOY_KEY_URL, **login_kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/doctr/local.py", line 223, in GitHub_post
    GitHub_raise_for_status(r)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/doctr/local.py", line 212, in GitHub_raise_for_status
    r.raise_for_status()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.github.com/repos/vstadnytskyi/github-practice-template/keys

I have a feeling I have had this problem in the past :( I can figure out the solution again.

I think it is problem with my GitHub.

failing to upload my package with twine

I am having troubles with uploading my new package to Pypi.org.

Original terminal snippet and the error:

HTTPError: 400 Client Error: '0.0.0.post1.dev0+g83905ac' is an invalid value for Version. Error: Can't use PEP 440 local versions. See https://packaging.python.org/specifications/core-metadata for url: https://upload.pypi.org/legacy/

or I get this error

HTTPError: 400 Client Error: 'X.Y.ZZ.post0.dev0-g83905ac' is an invalid value for Version. Error: Start and end with a letter or numeral containing only ASCII numeric and '.', '_' and '-'. See https://packaging.python.org/specifications/core-metadata for url: https://upload.pypi.org/legacy/

Unable to use the template on Azure Devops

Hello,
Thank you for assembling this resource. It is very helpful and all the hard work is appreciated. I tried to follow the instructions step by step with the only deviation being that I am using Azure Devops. I run into an error on Step 7 of the "Getting Started" guide and was wondering if you could kindly help fix it.

 raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/NSLS-II/scientific-python-cookiecutter']' returned non-zero exit status 128.

Migrate to pyproject.toml

I think it's PEP 621 that recommends we begin to migrate package metadata to the pyproject.toml file instead of a combination of setup.py, setup.cfg and other metadata files. I'm happy to take a shot at doing this if desired. I believe I know how (at the very least, I have a way to do it, which can be built upon). I can also provide a tutorial on how to couple it with GitHub actions (there is an open PR for this #105, but it appears to be quite stale). Let me know (I want to be sure there's still interest in making significant updates to this repo before I do)!

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.