Skip to content

Commit

Permalink
Merge pull request #23 from sot/de-namespace
Browse files Browse the repository at this point in the history
De namespace
  • Loading branch information
taldcroft authored Jan 21, 2023
2 parents ed1c81b + 2042d0c commit 4fcf303
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 24 deletions.
16 changes: 8 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Ska.DBI documentation build configuration file, created by
# ska_dbi documentation build configuration file, created by
# sphinx-quickstart on Tue May 19 15:46:11 2020.
#
# This file is execfile()d with the current directory set to its
Expand All @@ -20,7 +20,7 @@
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
from Ska.DBI import __version__
from ska_dbi import __version__

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -49,7 +49,7 @@
master_doc = 'index'

# General information about the project.
project = 'Ska.DBI'
project = 'ska_dbi'
copyright = '2020, Tom Aldcroft'
author = 'Tom Aldcroft'

Expand Down Expand Up @@ -89,8 +89,8 @@
html_theme = 'bootstrap-ska'
html_theme_options = {
'logotext1': 'Ska! ', # white, semi-bold
'logotext2': 'Ska', # orange, light
'logotext3': '.DBI', # white, light
'logotext2': 'ska_dbi', # orange, light
'logotext3': '', # white, light
'homepage_url': 'https://cxc.cfa.harvard.edu/mta/ASPECT/tool_doc',
'homepage_text': 'ska',
'homepage_text_2': 'tools'
Expand Down Expand Up @@ -153,7 +153,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'SkaDBI.tex', 'Ska.DBI Documentation',
(master_doc, 'SkaDBI.tex', 'ska_dbi Documentation',
'Tom Aldcroft', 'manual'),
]

Expand All @@ -163,7 +163,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'chandratime', 'Ska.DBI Documentation',
(master_doc, 'chandratime', 'ska_dbi Documentation',
[author], 1)
]

Expand All @@ -174,7 +174,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'SkaDBI', 'Ska.DBI Documentation',
(master_doc, 'SkaDBI', 'ska_dbi Documentation',
author, 'SkaDBI', 'One line description of project.',
'Miscellaneous'),
]
Expand Down
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
:mod:`Ska.DBI`
:mod:`ska_dbi`
===============================================================================================================================================


.. automodule:: Ska.DBI.DBI
.. automodule:: ska_dbi.DBI


Functions
Expand All @@ -21,7 +21,7 @@ Classes
:members:
:inherited-members:
:undoc-members:




23 changes: 16 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from setuptools import setup
from testr.setup_helper import cmdclass
from ska_helpers.setup_helper import duplicate_package_info

try:
from testr.setup_helper import cmdclass
except ImportError:
cmdclass = {}
name = "ska_dbi"
namespace = "Ska.DBI"

setup(name='Ska.DBI',
packages = ["ska_dbi", "ska_dbi.tests"]
package_dir = {name: name}
package_data = {'ska_dbi.tests': ['ska_dbi_test_table.sql']}

duplicate_package_info(packages, name, namespace)
duplicate_package_info(package_dir, name, namespace)
duplicate_package_info(package_data, name, namespace)

setup(name=name,
author='Tom Aldcroft',
description='Database interface utilities',
author_email='taldcroft@cfa.harvard.edu',
use_scm_version=True,
setup_requires=['setuptools_scm', 'setuptools_scm_git_archive'],
zip_safe=False,
packages=['Ska', 'Ska.DBI', 'Ska.DBI.tests'],
package_data={'Ska.DBI.tests': ['ska_dbi_test_table.sql']},
package_dir=package_dir,
packages=packages,
package_data=package_data,
tests_require=['pytest'],
cmdclass=cmdclass,
)
4 changes: 2 additions & 2 deletions Ska/DBI/DBI.py → ska_dbi/DBI.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Ska.DBI provides simple methods for database access and data insertion.
ska_dbi provides simple methods for database access and data insertion.
Features:
- Sqlite and sybase connections are supported.
Expand Down Expand Up @@ -188,7 +188,7 @@ def fetch(self, expr, vals=None,):

def fetchone(self, expr, vals=None,):
"""Fetch one row after executing args. This always gets the first row of the
SQL query. Use Ska.DBI.fetch() to get multiple rows one at a time.
SQL query. Use ska_dbi.fetch() to get multiple rows one at a time.
Example usage::
Expand Down
2 changes: 1 addition & 1 deletion Ska/DBI/__init__.py → ska_dbi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from .DBI import *

__version__ = ska_helpers.get_version('Ska.DBI')
__version__ = ska_helpers.get_version('ska_dbi')


def test(*args, **kwargs):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Test table for Ska.DBI
-- Test table for ska_dbi

CREATE TABLE ska_dbi_test_table (
id int not null,
Expand All @@ -12,7 +12,7 @@ CREATE TABLE ska_dbi_test_table (
aspect_mode varchar(12),
sim_mode char(6),
CONSTRAINT pk_id PRIMARY KEY (id)
)
)
;

CREATE INDEX obi_idx ON ska_dbi_test_table (obi)
2 changes: 1 addition & 1 deletion Ska/DBI/tests/test_dbi.py → ska_dbi/tests/test_dbi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import numpy as np
import tempfile

from Ska.DBI import DBI
from ska_dbi import DBI


# If the SYBASE_OCS environment variable is set (from flt_envs) and the module exists
Expand Down

0 comments on commit 4fcf303

Please sign in to comment.