From 5093496b75f94abd08abaaf0a5403d19e9460d40 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Tue, 9 Jun 2020 16:38:52 -0300 Subject: [PATCH 1/2] We cannot upload it with the name mymodule --- .gitignore | 2 +- .travis.yml | 12 ++++----- MANIFEST.in | 2 +- README.md | 16 ++++++------ docs/Makefile | 2 +- docs/source/conf.py | 26 ++++++++++--------- docs/source/how2package4ioos.md | 18 +++++++------ docs/source/index.rst | 10 +++---- docs/source/ioos_pkg_skeleton.rst | 7 +++++ docs/source/mymodule.rst | 7 ----- {mymodule => ioos_pkg_skeleton}/__init__.py | 2 +- .../ioos_pkg_skeleton.py | 4 +-- notebooks/IOOS-Python-Package-Skeleton.ipynb | 14 +++++----- notebooks/tutorial.ipynb | 8 +++--- setup.cfg | 4 +-- setup.py | 2 +- ..._mymodule.py => test_ioos_pkg_skeleton.py} | 2 +- 17 files changed, 71 insertions(+), 67 deletions(-) create mode 100644 docs/source/ioos_pkg_skeleton.rst delete mode 100644 docs/source/mymodule.rst rename {mymodule => ioos_pkg_skeleton}/__init__.py (65%) rename mymodule/mymodule.py => ioos_pkg_skeleton/ioos_pkg_skeleton.py (91%) rename tests/{test_mymodule.py => test_ioos_pkg_skeleton.py} (84%) diff --git a/.gitignore b/.gitignore index aaa8f2c..9794588 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ build/ dist/ docs/source/tutorial.ipynb -mymodule/_version.py +ioos_pkg_skeleton/_version.py diff --git a/.travis.yml b/.travis.yml index 8e76033..818c3cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,14 +12,14 @@ matrix: include: - name: "python-3.6" env: PY=3.6 - - name: "python-3.7" - env: PY=3.7 + - name: "python-3.8" + env: PY=3.8 - name: "coding_standards" - env: PY=3.7 + env: PY=3 - name: "tarball" - env: PY=3.7 + env: PY=3 - name: "docs" - env: PY=3.7 + env: PY=3 before_install: # Install miniconda and create TEST env. @@ -42,7 +42,7 @@ install: script: - if [[ $TRAVIS_JOB_NAME == python-* ]]; then cp -r tests/ /tmp ; - pushd /tmp && pytest -n 2 -rxs --cov=mymodule tests && popd ; + pushd /tmp && pytest -n 2 -rxs --cov=ioos_pkg_skeleton tests && popd ; fi - if [[ $TRAVIS_JOB_NAME == 'tarball' ]]; then diff --git a/MANIFEST.in b/MANIFEST.in index 4eeb3ad..987c373 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ include *.txt include README.md -recursive-include mymodule *.py +recursive-include ioos_pkg_skeleton *.py diff --git a/README.md b/README.md index 5fda2ac..e6cacfe 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## MYMODULE +## ioos_pkg_skeleton [![Build Status](https://travis-ci.com/ioos/ioos-python-package-skeleton.svg?branch=master)](https://travis-ci.com/ioos/ioos-python-package-skeleton) @@ -13,32 +13,32 @@ URLs for the docs and code. For `conda` users you can ```shell -conda install --channel conda-forge mymodule +conda install --channel conda-forge ioos_pkg_skeleton ``` or, if you are a `pip` users ```shell -pip install mymodule +pip install ioos_pkg_skeleton ``` ### Example ```python -from mymodule import mymodule +from ioos_pkg_skeleton import ioos_pkg_skeleton -mymodule() +ioos_pkg_skeleton() ``` ## Get in touch -Report bugs, suggest features or view the source code on [GitHub](https://github.com/ioos/mymodule/issues). +Report bugs, suggest features or view the source code on [GitHub](https://github.com/ioos/ioos_pkg_skeleton/issues). ## License and copyright -mymodule is licensed under BSD 3-Clause "New" or "Revised" License (BSD-3-Clause). +ioos_pkg_skeleton is licensed under BSD 3-Clause "New" or "Revised" License (BSD-3-Clause). -Development occurs on GitHub at . +Development occurs on GitHub at . diff --git a/docs/Makefile b/docs/Makefile index 89f65ac..3657e93 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -4,7 +4,7 @@ # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = python -msphinx -SPHINXPROJ = mymodule +SPHINXPROJ = ioos_pkg_skeleton SOURCEDIR = source BUILDDIR = build diff --git a/docs/source/conf.py b/docs/source/conf.py index 52ebd15..a665705 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- # -# MYMODULE documentation build configuration file, created by +# ioos_pkg_skeleton documentation build configuration file, created by # sphinx-quickstart on Mon Oct 9 21:28:42 2017. # # This file is execfile()d with the current directory set to its @@ -52,7 +52,7 @@ master_doc = "index" # General information about the project. -project = "MYMODULE" +project = "ioos_pkg_skeleton" copyright = "2017, Filipe Fernandes" author = "Filipe Fernandes" @@ -60,7 +60,7 @@ # |version| and |release|, also used in various other places throughout the # built documents. # -from mymodule import __version__ as VERSION # noqa +from ioos_pkg_skeleton import __version__ as VERSION # noqa version = VERSION @@ -99,9 +99,9 @@ # html_theme_options = { "logo": "logo.png", - "logo_name": "MYMODULE", + "logo_name": "ioos_pkg_skeleton", "github_user": "ioos", - "github_repo": "MYMODULE", + "github_repo": "ioos_pkg_skeleton", "github_banner": True, "travis_button": True, "fixed_sidebar": True, @@ -132,7 +132,7 @@ # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. -htmlhelp_basename = "MYMODULEdoc" +htmlhelp_basename = "ioos_pkg_skeletondoc" # -- Options for LaTeX output --------------------------------------------- @@ -158,8 +158,8 @@ latex_documents = [ ( master_doc, - "MYMODULE.tex", - "MYMODULE Documentation", + "ioos_pkg_skeleton.tex", + "ioos_pkg_skeleton Documentation", "Filipe Fernandes", "manual", ) @@ -170,7 +170,9 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [(master_doc, "MYMODULE", "MYMODULE Documentation", [author], 1)] +man_pages = [ + (master_doc, "ioos_pkg_skeleton", "ioos_pkg_skeleton Documentation", [author], 1) +] # -- Options for Texinfo output ------------------------------------------- @@ -181,10 +183,10 @@ texinfo_documents = [ ( master_doc, - "MYMODULE", - "MYMODULE Documentation", + "ioos_pkg_skeleton", + "ioos_pkg_skeleton Documentation", author, - "MYMODULE", + "ioos_pkg_skeleton", "One line description of project.", "Miscellaneous", ) diff --git a/docs/source/how2package4ioos.md b/docs/source/how2package4ioos.md index 5d07c37..6d58279 100644 --- a/docs/source/how2package4ioos.md +++ b/docs/source/how2package4ioos.md @@ -21,7 +21,7 @@ Almost all python packages are structure as following: | | |-_static | |-build |-tests -|-mymodule +|-ioos_pkg_skeleton |-notebooks |-README.md |-LICENSE.txt @@ -86,7 +86,7 @@ from setuptools import setup setup( use_scm_version={ - "write_to": "mymodule/_version.py", + "write_to": "ioos_pkg_skeleton/_version.py", "write_to_template": '__version__ = "{version}"', "tag_regex": r"^(?Pv)?(?P[^\+]+)(?P.*)?$", } @@ -112,7 +112,7 @@ The former will have the package metadata and tools configuration while the latt ```cfg [metadata] -name = mymodule +name = ioos_pkg_skeleton description = My Awesome module author = AUTHOR NAME author_email = AUTHOR@EMAIL.COM @@ -161,7 +161,7 @@ ignore = max-line-length = 105 select = C,E,F,W,B,B950 ignore = E203, E501, W503 -exclude = mymodule/_version.py +exclude = ioos_pkg_skeleton/_version.py ``` The metadata and options fields are almost the same information that used to go in the `setup.py`. @@ -184,7 +184,7 @@ include *.txt include LICENSE # Please consider the Windows users and use .txt include README.md -recursive-include mymodule *.py +recursive-include ioos_pkg_skeleton *.py ``` ## Do we still need a `requirements.txt` file? @@ -285,7 +285,7 @@ install: script: - if [[ $TRAVIS_JOB_NAME == python-* ]]; then cp -r tests/ /tmp ; - pushd /tmp && pytest -n 2 -rxs --cov=mymodule tests && popd ; + pushd /tmp && pytest -n 2 -rxs --cov=ioos_pkg_skeleton tests && popd ; fi - if [[ $TRAVIS_JOB_NAME == 'tarball' ]]; then @@ -373,7 +373,7 @@ repos: hooks: - id: isort additional_dependencies: [toml] - args: [--project=mymodule, --multi-line=3, --lines-after-imports=2, --lines-between-types=1, --trailing-comma, --force-grid-wrap=0, --use-parentheses, --line-width=88] + args: [--project=ioos_pkg_skeleton, --multi-line=3, --lines-after-imports=2, --lines-between-types=1, --trailing-comma, --force-grid-wrap=0, --use-parentheses, --line-width=88] - repo: https://github.com/asottile/seed-isort-config rev: v2.1.1 @@ -410,7 +410,7 @@ pre-commit run --all-files and ignoring it in a commit if you don't want it to run: ``` -git commit mymodule/some-dot-pwhy.py --no-verify +git commit ioos_pkg_skeleton/some-dot-pwhy.py --no-verify ``` ## Github Actions @@ -481,4 +481,6 @@ Please check out https://www.pyopensci.org/ ## TODO - auto PyPI publication +https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ + - conda-forge publication diff --git a/docs/source/index.rst b/docs/source/index.rst index 31a9cfe..f411a6d 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -6,11 +6,11 @@ Package Guidelines how2package4ioos.md -mymodule -======== +ioos_pkg_skeleton +================= -What is MYMODULE? ------------------ +What is ioos_pkg_skeleton? +-------------------------- The best module ever written! @@ -20,7 +20,7 @@ The best module ever written! :caption: Contents: tutorial.ipynb - mymodule + ioos_pkg_skeleton Indices and tables ================== diff --git a/docs/source/ioos_pkg_skeleton.rst b/docs/source/ioos_pkg_skeleton.rst new file mode 100644 index 0000000..6c7d962 --- /dev/null +++ b/docs/source/ioos_pkg_skeleton.rst @@ -0,0 +1,7 @@ +:mod:`ioos_pkg_skeleton API` +---------------------------- + +.. automodule:: ioos_pkg_skeleton.ioos_pkg_skeleton + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/mymodule.rst b/docs/source/mymodule.rst deleted file mode 100644 index 37f2e8b..0000000 --- a/docs/source/mymodule.rst +++ /dev/null @@ -1,7 +0,0 @@ -:mod:`mymodule API` -------------------- - -.. automodule:: mymodule.mymodule - :members: - :undoc-members: - :show-inheritance: diff --git a/mymodule/__init__.py b/ioos_pkg_skeleton/__init__.py similarity index 65% rename from mymodule/__init__.py rename to ioos_pkg_skeleton/__init__.py index 176f5a4..4a3a2ac 100644 --- a/mymodule/__init__.py +++ b/ioos_pkg_skeleton/__init__.py @@ -1,4 +1,4 @@ -from mymodule.mymodule import meaning_of_life, meaning_of_life_url +from ioos_pkg_skeleton.ioos_pkg_skeleton import meaning_of_life, meaning_of_life_url __all__ = [ diff --git a/mymodule/mymodule.py b/ioos_pkg_skeleton/ioos_pkg_skeleton.py similarity index 91% rename from mymodule/mymodule.py rename to ioos_pkg_skeleton/ioos_pkg_skeleton.py index 296728d..8a7b634 100644 --- a/mymodule/mymodule.py +++ b/ioos_pkg_skeleton/ioos_pkg_skeleton.py @@ -1,7 +1,7 @@ """ -mymodule +ioos_pkg_skeleton -My awesome mymodule +My awesome ioos_pkg_skeleton """ import numpy as np diff --git a/notebooks/IOOS-Python-Package-Skeleton.ipynb b/notebooks/IOOS-Python-Package-Skeleton.ipynb index 820248a..d543a45 100644 --- a/notebooks/IOOS-Python-Package-Skeleton.ipynb +++ b/notebooks/IOOS-Python-Package-Skeleton.ipynb @@ -66,7 +66,7 @@ "| | |-_static\n", "| |-build\n", "|-tests\n", - "|-mymodule\n", + "|-ioos_pkg_skeleton\n", "```\n", "\n", "Why are the tests outside of the module?" @@ -83,7 +83,7 @@ "\n", "setup(\n", " use_scm_version={\n", - " \"write_to\": \"mymodule/_version.py\",\n", + " \"write_to\": \"ioos_pkg_skeleton/_version.py\",\n", " \"write_to_template\": '__version__ = \"{version}\"',\n", " \"tag_regex\": r\"^(?Pv)?(?P[^\\+]+)(?P.*)?$\",\n", " }\n", @@ -100,7 +100,7 @@ "\n", "```cfg\n", "[metadata]\n", - "name = mymodule\n", + "name = ioos_pkg_skeleton\n", "description = My Awesome module\n", "author = AUTHOR NAME\n", "author_email = AUTHOR@EMAIL.COM\n", @@ -149,7 +149,7 @@ "max-line-length = 105\n", "select = C,E,F,W,B,B950\n", "ignore = E203, E501, W503\n", - "exclude = mymodule/_version.py\n", + "exclude = ioos_pkg_skeleton/_version.py\n", "```" ] }, @@ -211,7 +211,7 @@ "include LICENSE # Please consider the Windows users and use .txt\n", "include README.md\n", "\n", - "recursive-include mymodule *.py\n", + "recursive-include ioos_pkg_skeleton *.py\n", "```" ] }, @@ -332,7 +332,7 @@ "script:\n", " - if [[ $TRAVIS_JOB_NAME == python-* ]]; then\n", " cp -r tests/ /tmp ;\n", - " pushd /tmp && pytest -n 2 -rxs --cov=mymodule tests && popd ;\n", + " pushd /tmp && pytest -n 2 -rxs --cov=ioos_pkg_skeleton tests && popd ;\n", " fi\n", "\n", "```" @@ -457,7 +457,7 @@ " hooks:\n", " - id: isort\n", " additional_dependencies: [toml]\n", - " args: [--project=mymodule, --multi-line=3, --lines-after-imports=2, --lines-between-types=1, --trailing-comma, --force-grid-wrap=0, --use-parentheses, --line-width=88]\n", + " args: [--project=ioos_pkg_skeleton, --multi-line=3, --lines-after-imports=2, --lines-between-types=1, --trailing-comma, --force-grid-wrap=0, --use-parentheses, --line-width=88]\n", "\n", "- repo: https://github.com/asottile/seed-isort-config\n", " rev: v2.1.1\n", diff --git a/notebooks/tutorial.ipynb b/notebooks/tutorial.ipynb index b1b1e73..9cefa14 100644 --- a/notebooks/tutorial.ipynb +++ b/notebooks/tutorial.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# mymodule tutorial" + "# ioos_pkg_skeleton tutorial" ] }, { @@ -26,10 +26,10 @@ } ], "source": [ - "import mymodule\n", + "import ioos_pkg_skeleton\n", "\n", "\n", - "mymodule.meaning_of_life(3)" + "ioos_pkg_skeleton.meaning_of_life(3)" ] }, { @@ -49,7 +49,7 @@ } ], "source": [ - "mymodule.meaning_of_life_url()" + "ioos_pkg_skeleton.meaning_of_life_url()" ] } ], diff --git a/setup.cfg b/setup.cfg index 1ce9580..76107be 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = mymodule +name = ioos_pkg_skeleton description = My Awesome module author = AUTHOR NAME author_email = AUTHOR@EMAIL.COM @@ -48,4 +48,4 @@ ignore = max-line-length = 105 select = C,E,F,W,B,B950 ignore = E203, E501, W503 -exclude = mymodule/_version.py +exclude = ioos_pkg_skeleton/_version.py diff --git a/setup.py b/setup.py index ad47347..7e43099 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( use_scm_version={ - "write_to": "mymodule/_version.py", + "write_to": "ioos_pkg_skeleton/_version.py", "write_to_template": '__version__ = "{version}"', "tag_regex": r"^(?Pv)?(?P[^\+]+)(?P.*)?$", } diff --git a/tests/test_mymodule.py b/tests/test_ioos_pkg_skeleton.py similarity index 84% rename from tests/test_mymodule.py rename to tests/test_ioos_pkg_skeleton.py index 7bb0031..2d729fa 100644 --- a/tests/test_mymodule.py +++ b/tests/test_ioos_pkg_skeleton.py @@ -1,7 +1,7 @@ import numpy as np import pytest -from mymodule import meaning_of_life, meaning_of_life_url +from ioos_pkg_skeleton import meaning_of_life, meaning_of_life_url @pytest.mark.web From 36132c227e7223a5deb2dc5700dc8ba6264edae4 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Tue, 9 Jun 2020 16:41:37 -0300 Subject: [PATCH 2/2] fix README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e6cacfe..162ce9a 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ pip install ioos_pkg_skeleton from ioos_pkg_skeleton import ioos_pkg_skeleton -ioos_pkg_skeleton() +ioos_pkg_skeleton.meaning_of_life_url() ```