Skip to content

Commit

Permalink
Merge pull request #5 from ocefpaf/mymodule-is-not-uploadable
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf authored Jun 9, 2020
2 parents a379409 + 36132c2 commit 626cd51
Show file tree
Hide file tree
Showing 17 changed files with 71 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
build/
dist/
docs/source/tutorial.ipynb
mymodule/_version.py
ioos_pkg_skeleton/_version.py
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include *.txt
include README.md

recursive-include mymodule *.py
recursive-include ioos_pkg_skeleton *.py
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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.meaning_of_life_url()
```


## 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 <https://github.com/ioos/mymodule>.
Development occurs on GitHub at <https://github.com/ioos/ioos_pkg_skeleton>.
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
26 changes: 14 additions & 12 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -52,15 +52,15 @@
master_doc = "index"

# General information about the project.
project = "MYMODULE"
project = "ioos_pkg_skeleton"
copyright = "2017, Filipe Fernandes"
author = "Filipe Fernandes"

# The version info for the project you're documenting, acts as replacement for
# |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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 ---------------------------------------------
Expand All @@ -158,8 +158,8 @@
latex_documents = [
(
master_doc,
"MYMODULE.tex",
"MYMODULE Documentation",
"ioos_pkg_skeleton.tex",
"ioos_pkg_skeleton Documentation",
"Filipe Fernandes",
"manual",
)
Expand All @@ -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 -------------------------------------------
Expand All @@ -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",
)
Expand Down
18 changes: 10 additions & 8 deletions docs/source/how2package4ioos.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Almost all python packages are structure as following:
| | |-_static
| |-build
|-tests
|-mymodule
|-ioos_pkg_skeleton
|-notebooks
|-README.md
|-LICENSE.txt
Expand Down Expand Up @@ -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"^(?P<prefix>v)?(?P<version>[^\+]+)(?P<suffix>.*)?$",
}
Expand All @@ -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 = [email protected]
Expand Down Expand Up @@ -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`.
Expand All @@ -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?
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
10 changes: 5 additions & 5 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand All @@ -20,7 +20,7 @@ The best module ever written!
:caption: Contents:

tutorial.ipynb
mymodule
ioos_pkg_skeleton

Indices and tables
==================
Expand Down
7 changes: 7 additions & 0 deletions docs/source/ioos_pkg_skeleton.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:mod:`ioos_pkg_skeleton API`
----------------------------

.. automodule:: ioos_pkg_skeleton.ioos_pkg_skeleton
:members:
:undoc-members:
:show-inheritance:
7 changes: 0 additions & 7 deletions docs/source/mymodule.rst

This file was deleted.

2 changes: 1 addition & 1 deletion mymodule/__init__.py → ioos_pkg_skeleton/__init__.py
Original file line number Diff line number Diff line change
@@ -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__ = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
mymodule
ioos_pkg_skeleton
My awesome mymodule
My awesome ioos_pkg_skeleton
"""

import numpy as np
Expand Down
14 changes: 7 additions & 7 deletions notebooks/IOOS-Python-Package-Skeleton.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
Expand All @@ -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\"^(?P<prefix>v)?(?P<version>[^\\+]+)(?P<suffix>.*)?$\",\n",
" }\n",
Expand All @@ -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 = [email protected]\n",
Expand Down Expand Up @@ -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",
"```"
]
},
Expand Down Expand Up @@ -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",
"```"
]
},
Expand Down Expand Up @@ -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",
"```"
Expand Down Expand Up @@ -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",
Expand Down
Loading

0 comments on commit 626cd51

Please sign in to comment.