-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
first version #1
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e1092e5
first version
javierggt 3ab1a91
first version
javierggt 20b5d94
added usage hint to readme
javierggt cab8642
guard against the case when a version of the module is installed but …
javierggt f2ef748
get_version package argument should be explicitly given, and added gi…
javierggt 77b9ca1
already a bugfix: exception was not being raised, and clear vdersion …
javierggt 7dca839
rename aca_helpers -> ska_helpers
javierggt ec54156
some small fixes, including name change
javierggt e06c0a4
Implementation tweaks
taldcroft e7cabd0
Check for local git directory
taldcroft 69da1b0
if filename is not __init__.py, the depth is different.
javierggt 2e52580
convert to strings to numbers. This weird syntax is so it works even …
javierggt 04f93ce
debug output changes
javierggt feec374
Merge branch 'master' into first_version
javierggt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ref-names: $Format:%D$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.git_archival.txt export-subst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2019, sot | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,12 @@ | ||
# ska_helpers | ||
|
||
This is a collection of utilities for ACA packages. | ||
It currently includes: | ||
|
||
- get_version. A function to get the version from installed package information ot git. | ||
|
||
from ska_helpers import get_version | ||
version = get_version('chandra_aca') | ||
|
||
import ska_helpers.version | ||
print(ska_helpers.version.parse_version(version)) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = python -msphinx | ||
SPHINXPROJ = ska_helpers | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# ska_helpers documentation build configuration file, created by | ||
# sphinx-quickstart on Fri Dec 13 09:48:53 2019. | ||
# | ||
# This file is execfile()d with the current directory set to its | ||
# containing dir. | ||
# | ||
# Note that not all possible configuration values are present in this | ||
# autogenerated file. | ||
# | ||
# All configuration values have a default; values that are commented out | ||
# serve to show the default. | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
# | ||
import sys | ||
import os | ||
sys.path.insert(0, os.path.abspath('..')) | ||
from ska_helpers import __version__ | ||
|
||
|
||
# -- General configuration ------------------------------------------------ | ||
|
||
# If your documentation needs a minimal Sphinx version, state it here. | ||
# | ||
# needs_sphinx = '1.0' | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = ['sphinx.ext.autodoc', | ||
'sphinx.ext.doctest', | ||
'sphinx.ext.coverage'] | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ['_templates'] | ||
|
||
# The suffix(es) of source filenames. | ||
# You can specify multiple suffix as a list of string: | ||
# | ||
# source_suffix = ['.rst', '.md'] | ||
source_suffix = '.rst' | ||
|
||
# The master toctree document. | ||
master_doc = 'index' | ||
|
||
# General information about the project. | ||
project = 'ACA Helpers' | ||
copyright = '2019, Javier Gonzalez' | ||
author = 'Javier Gonzalez' | ||
|
||
# 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. | ||
# | ||
# The short X.Y version. | ||
version = __version__ | ||
# The full version, including alpha/beta/rc tags. | ||
release = __version__ | ||
|
||
# The language for content autogenerated by Sphinx. Refer to documentation | ||
# for a list of supported languages. | ||
# | ||
# This is also used if you do content translation via gettext catalogs. | ||
# Usually you set "language" from the command line for these cases. | ||
language = None | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This patterns also effect to html_static_path and html_extra_path | ||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | ||
|
||
# The name of the Pygments (syntax highlighting) style to use. | ||
pygments_style = 'sphinx' | ||
|
||
# If true, `todo` and `todoList` produce output, else they produce nothing. | ||
todo_include_todos = False | ||
|
||
|
||
# -- Options for HTML output ---------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# | ||
html_theme = 'default' | ||
|
||
# Theme options are theme-specific and customize the look and feel of a theme | ||
# further. For a list of options available for each theme, see the | ||
# documentation. | ||
# | ||
# html_theme_options = {} | ||
|
||
# Add any paths that contain custom static files (such as style sheets) here, | ||
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
html_static_path = ['_static'] | ||
|
||
# Custom sidebar templates, must be a dictionary that maps document names | ||
# to template names. | ||
# | ||
# This is required for the alabaster theme | ||
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars | ||
# html_sidebars = {} | ||
|
||
|
||
# -- Options for HTMLHelp output ------------------------------------------ | ||
|
||
# Output file base name for HTML help builder. | ||
htmlhelp_basename = 'ska_helpers_doc' | ||
|
||
|
||
# -- Options for LaTeX output --------------------------------------------- | ||
|
||
latex_elements = { | ||
} | ||
|
||
# Grouping the document tree into LaTeX files. List of tuples | ||
# (source start file, target name, title, | ||
# author, documentclass [howto, manual, or own class]). | ||
latex_documents = [ | ||
(master_doc, 'ska_helpers.tex', 'aca\\_helpers Documentation', | ||
'Javier Gonzalez', 'manual'), | ||
] | ||
|
||
|
||
# -- Options for manual page output --------------------------------------- | ||
|
||
# One entry per manual page. List of tuples | ||
# (source start file, name, description, authors, manual section). | ||
man_pages = [ | ||
(master_doc, 'ska_helpers', 'ska_helpers Documentation', | ||
[author], 1) | ||
] | ||
|
||
|
||
# -- Options for Texinfo output ------------------------------------------- | ||
|
||
# Grouping the document tree into Texinfo files. List of tuples | ||
# (source start file, target name, title, author, | ||
# dir menu entry, description, category) | ||
texinfo_documents = [ | ||
(master_doc, 'ska_helpers', 'ska_helpers Documentation', | ||
author, 'ska_helpers', 'One line description of project.', | ||
'Miscellaneous'), | ||
] | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
.. ska_helpers documentation master file, created by | ||
sphinx-quickstart on Fri Dec 13 09:48:53 2019. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
|
||
ACA Package Helpers | ||
=================== | ||
|
||
.. automodule:: ska_helpers | ||
:members: | ||
|
||
Get Version | ||
----------- | ||
|
||
.. automodule:: ska_helpers.get_version | ||
:members: | ||
|
||
|
||
Default versioning scheme | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
What follows is the scheme as described in `setuptools_scm's documentation <https://github.com/pypa/setuptools_scm/>`. | ||
|
||
In the standard configuration ``setuptools_scm`` takes a look at three things: | ||
|
||
1. latest tag (with a version number) | ||
2. the distance to this tag (e.g. number of revisions since latest tag) | ||
3. workdir state (e.g. uncommitted changes since latest tag) | ||
|
||
and uses roughly the following logic to render the version: | ||
|
||
no distance and clean: | ||
``{tag}`` | ||
distance and clean: | ||
``{next_version}.dev{distance}+{scm letter}{revision hash}`` | ||
no distance and not clean: | ||
``{tag}+dYYYMMMDD`` | ||
distance and not clean: | ||
``{next_version}.dev{distance}+{scm letter}{revision hash}.dYYYMMMDD`` | ||
|
||
The next version is calculated by adding ``1`` to the last numeric component of | ||
the tag. | ||
|
||
For Git projects, the version relies on `git describe <https://git-scm.com/docs/git-describe>`_, | ||
so you will see an additional ``g`` prepended to the ``{revision hash}``. | ||
|
||
|
||
Due to the default behavior it's necessary to always include a | ||
patch version (the ``3`` in ``1.2.3``), or else the automatic guessing | ||
will increment the wrong part of the SemVer (e.g. tag ``2.0`` results in | ||
``2.1.devX`` instead of ``2.0.1.devX``). So please make sure to tag | ||
accordingly. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
from setuptools import setup | ||
|
||
try: | ||
from testr.setup_helper import cmdclass | ||
except ImportError: | ||
cmdclass = {} | ||
|
||
setup(name='ska_helpers', | ||
description='Utilities for ska packages', | ||
author='Javier Gonzalez', | ||
author_email='javier.gonzalez@cfa.harvard.edu', | ||
url='http://cxc.harvard.edu/mta/ASPECT/tool_doc/ska_helpers.html', | ||
packages=['ska_helpers'], | ||
tests_require=['pytest'], | ||
use_scm_version=True, | ||
setup_requires=['setuptools_scm', 'setuptools_scm_git_archive'], | ||
cmdclass=cmdclass, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
""" | ||
Ska_helpers is a collection of utilities for the Ska3 runtime environment. | ||
|
||
ska_helpers.version | ||
------------------- | ||
- get_version: get the version from installed package information or git. | ||
- parse_version: parse the version into a dict of components. | ||
""" | ||
from .version import get_version | ||
|
||
__version__ = get_version(__package__) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setup_helper
would be a perfect candidate to migrate into this package. We do not need to remove the old one, but if we makeska_helpers
a standard entry insetup_requires
then one can imagine justThe
ska-helpers
package can be put on PyPI to always be available for a networked machine.