diff --git a/.copier-answers.yml b/.copier-answers.yml index ed0201fe..11c3dd20 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,13 +1,14 @@ # Changes here will be overwritten by Copier -_commit: v1.3.3 +_commit: v1.4.1 _src_path: gh:lincc-frameworks/python-project-template author_email: lincc-frameworks-team@lists.lsst.org author_name: LINCC Frameworks create_example_module: false custom_install: true +include_docs: true include_notebooks: false -module_name: lsdb mypy_type_checking: basic +package_name: lsdb preferred_linter: pylint project_license: BSD project_name: lsdb diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml index a3a7b32a..36f0b6cd 100644 --- a/.github/workflows/build-documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -24,9 +24,8 @@ jobs: run: | sudo apt-get update python -m pip install --upgrade pip + if [ -f docs/requirements.txt ]; then pip install -r docs/requirements.txt; fi pip install . - pip install .[dev] - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Build docs run: | - sphinx-build -T -E -b html -d docs/build/doctrees ./docs docs/build/html \ No newline at end of file + sphinx-build -T -E -b html -d docs/build/doctrees ./docs docs/build/html diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index bc0ef2cc..0c907d73 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -33,4 +33,3 @@ jobs: run: | pylint -rn -sn --recursive=y ./src --rcfile=./src/.pylintrc - diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index a0754794..5367eb63 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -36,4 +36,4 @@ jobs: uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 0f286dec..df093f48 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -1,5 +1,7 @@ # This workflow will run daily at 06:45. # It will install Python dependencies and run tests with a variety of Python versions. +# See documentation for help debugging smoke test issues: +# https://lincc-ppt.readthedocs.io/en/latest/practices/ci_testing.html#version-culprit name: Unit test smoke test @@ -30,6 +32,9 @@ jobs: pip install . pip install .[dev] if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: List dependencies + run: | + pip list - name: Run unit tests with pytest run: | python -m pytest tests diff --git a/.github/workflows/type-checking.yml b/.github/workflows/type-checking.yml index 59a5461c..2c4408db 100644 --- a/.github/workflows/type-checking.yml +++ b/.github/workflows/type-checking.yml @@ -33,4 +33,3 @@ jobs: run: | mypy ./src ./tests --ignore-missing-imports - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0f56e032..3f4f5231 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ repos: # This hook should always pass. It will print a message if the local version # is out of date. - repo: https://github.com/lincc-frameworks/pre-commit-hooks - rev: v0.1 + rev: v0.1.1 hooks: - id: check-lincc-frameworks-template-version name: Check template version @@ -132,7 +132,7 @@ repos: "-b", # Flag to select which builder to use "html", # Use the HTML builder "-d", # Flag for cached environment and doctrees - "docs/build/doctrees", # directory + "./docs/_build/doctrees", # directory "./docs", # Source directory of documents - "docs/build/html", # Output directory for rendered documents. - ] \ No newline at end of file + "./_readthedocs", # Output directory for rendered documents. + ] diff --git a/.prepare_project.sh b/.prepare_project.sh new file mode 100644 index 00000000..17b1b5e8 --- /dev/null +++ b/.prepare_project.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +echo "Initializing local git repository" +{ + gitversion=( $(git version | sed 's/^.* //;s/\./ /g') ) + if let "${gitversion[0]}<2"; then + # manipulate directly + git init . && echo 'ref: refs/heads/main' >.git/HEAD + elif let "${gitversion[0]}==2 & ${gitversion[1]}<34"; then + # rename master to main + git init . && { git branch -m master main 2>/dev/null || true; }; + else + # set the initial branch name to main + git init --initial-branch=main >/dev/null + fi +} > /dev/null + +echo "Installing package and runtime dependencies in local environment" +pip install -e . > /dev/null + +echo "Installing developer dependencies in local environment" +pip install -e .'[dev]' > /dev/null + +echo "Installing pre-commit" +pre-commit install > /dev/null diff --git a/.readthedocs.yml b/.readthedocs.yml index 817d2b0b..79bfc272 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,6 +1,6 @@ # .readthedocs.yml # Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details # Required version: 2 @@ -19,4 +19,4 @@ python: install: - requirements: docs/requirements.txt - method: pip - path: . \ No newline at end of file + path: . diff --git a/LICENSE b/LICENSE index e5f3508b..aee3ea7c 100644 --- a/LICENSE +++ b/LICENSE @@ -25,4 +25,4 @@ 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. \ No newline at end of file +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/docs/conf.py b/docs/conf.py index 39d7508c..57122108 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,9 +6,9 @@ import os import sys +from importlib.metadata import version import autoapi -from importlib.metadata import version # Define path to the code to be documented **relative to where conf.py (this file) is kept** sys.path.insert(0, os.path.abspath("../src/")) @@ -31,11 +31,13 @@ extensions.append("autoapi.extension") templates_path = [] -exclude_patterns = ['_build', '**.ipynb_checkpoints'] +exclude_patterns = ["_build", "**.ipynb_checkpoints"] master_doc = "index" # This assumes that sphinx-build is called from the root directory -html_show_sourcelink = False # Remove 'view source code' from top of page (for html, not python) -add_module_names = False # Remove namespaces from class/method signatures +html_show_sourcelink = ( + False # Remove 'view source code' from top of page (for html, not python) +) +add_module_names = False # Remove namespaces from class/method signatures autoapi_type = "python" autoapi_dirs = ["../src"] diff --git a/docs/requirements.txt b/docs/requirements.txt index 36b39474..dfb53d03 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,3 @@ sphinx==6.1.3 -sphinx_rtd_theme==1.2.0 -sphinx-autoapi==2.0.1 \ No newline at end of file +sphinx-rtd-theme==1.2.0 +sphinx-autoapi==2.0.1 diff --git a/pyproject.toml b/pyproject.toml index 037be900..e8325770 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,15 +28,23 @@ dev = [ "pytest", "pytest-cov", # Used to report total code coverage "sphinx==6.1.3", # Used to automatically generate documentation - "sphinx_rtd_theme==1.2.0", # Used to render documentation + "sphinx-rtd-theme==1.2.0", # Used to render documentation "sphinx-autoapi==2.0.1", # Used to automatically generate api documentation ] [build-system] requires = [ - "setuptools>=45", # Used to build and package the Python project + "setuptools>=62", # Used to build and package the Python project "setuptools_scm>=6.2", # Gets release version from git. Makes it available programmatically ] build-backend = "setuptools.build_meta" [tool.setuptools_scm] write_to = "src/lsdb/_version.py" + +[tool.pytest.ini_options] +testpaths = [ + "tests", +] + +[tool.setuptools.package-data] +lsdb = ["py.typed"] diff --git a/src/lsdb/py.typed b/src/lsdb/py.typed new file mode 100644 index 00000000..e69de29b