Skip to content

Commit

Permalink
Refactor with API (pytroll#2)
Browse files Browse the repository at this point in the history
Merge pytroll#2
  • Loading branch information
pkhalaj authored May 22, 2024
1 parent 96abd41 commit 7675129
Show file tree
Hide file tree
Showing 49 changed files with 2,701 additions and 251 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Continuous Integration

on:
push:
branches: [ "master", "main" ]
pull_request:
branches: [ "master", "main" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
env:
PYTHON_VERSION: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install mongodb
run: |
sudo apt install -y gnupg curl
curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
sudo apt-get update
sudo apt install -y mongodb-org
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ruff pytest pytest-lazy-fixtures pytest-asyncio pytest-cov
python -m pip install -e .
- name: Test with pytest
run: |
pytest --asyncio-mode=auto --cov=trolldb --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: pytroll/pytroll-db
file: ./coverage.xml
env_vars: PYTHON_VERSION
27 changes: 27 additions & 0 deletions .github/workflows/deploy-sdist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy sdist

on:
release:
types:
- published

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Create sdist
shell: bash -l {0}
run: |
python -m pip install -q build
python -m build -s
- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}
23 changes: 0 additions & 23 deletions .github/workflows/pylint.yml

This file was deleted.

17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ coverage.xml
# Django stuff:
*.log
*.pot
log

# Sphinx documentation
docs/_build/
docs/build/
*.rst
!index.rst
*.doctree
*.pickle

# the actual config file [HAS TO BE ALWAYS EXCLUDED!]
config.yaml
config.yml

# temp log and storage for the test database
__temp*

# version file
version.py
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
exclude: '^$'
fail_fast: false

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.3.7'
hooks:
- id: ruff
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: no-commit-to-branch
23 changes: 23 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
35 changes: 32 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
doobie
======
The database interface of `Pytroll <https://pytroll.github.io/>`_

Database interface for pytroll

.. image:: https://results.pre-commit.ci/badge/github/pytroll/pytroll-db/master.svg
:target: https://results.pre-commit.ci/latest/github/pytroll/pytroll-db/master
:alt: pre-commit.ci status


Copyright (C)
2012, 2014, 2015, 2024

Martin Raspaud, Pouria Khalaj, Esben S. Nielsen, Adam Dybbroe, Kristian Rune Larsen


Authors
- Martin Raspaud <[email protected]>
- Pouria Khalaj <[email protected]>
- Esben S. Nielsen <[email protected]>
- Adam Dybbroe <[email protected]>
- Kristian Rune Larsen <[email protected]>


License
Consult the `LICENSE` file which is included as a part of this package.


Disclaimer
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. You should have
received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
137 changes: 0 additions & 137 deletions bin/pytroll-mongo.py

This file was deleted.

2 changes: 0 additions & 2 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,3 @@ Other
postgreSQL/postGIS database. [Adam Dybbroe]

- Initial commit. [Martin Raspaud]


11 changes: 11 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SOURCE_DIR := source

.DEFAULT_GOAL := html
.PHONY: clean html

clean:
@cd $(SOURCE_DIR) && find . -type f ! -name 'index.rst' ! -name 'conf.py' -delete
@cd $(SOURCE_DIR) && find . -type d -delete

html:
@cd $(SOURCE_DIR) && python -m sphinx -T -b html -d _build/doctrees -D language=en . build/html
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx
sphinx-rtd-theme
Loading

0 comments on commit 7675129

Please sign in to comment.