Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions .github/workflows/python-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,19 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up mamba ${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: 'latest'
environment-file: environment.yml
init-shell: bash
environment-name: timescale
cache-environment: true
post-cleanup: 'all'
create-args: >-
python=${{ matrix.python-version }}
flake8
pytest
pytest-cov
pytest-xdist
- name: Set up pixi environment
uses: prefix-dev/setup-pixi@v0.9.1
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
pixi run lint
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
pixi run lint "--exit-zero --max-complexity=10 --max-line-length=127"
- name: Test with pytest
run: |
pip install --no-deps .
pytest -n 0 --cov=./ --cov-report=xml \
# install the package in editable mode
pip install --no-deps --editable .
pixi run --environment dev pytest -n 0 --cov=./ --cov-report=xml \
--username=${{ secrets.EARTHDATA_USERNAME }} \
--password=${{ secrets.EARTHDATA_PASSWORD }}
- name: Archive code coverage results
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ wheels/
.installed.cfg
*.egg
.pytest_cache
.coverage
pythonenv*/
venv/
*build-commands.txt
setup-miniconda-patched-environment.yml
# OS generated files #
######################
Expand All @@ -66,6 +69,7 @@ Thumbs.db
*.ilg
*.ind
*.ist
*.jats
*.lof
*.lot
*.nav
Expand All @@ -92,3 +96,7 @@ None*.png
#######################
.ipynb_checkpoints
Untitled.ipynb
core.*
# pixi environments
.pixi/*
!.pixi/config.toml
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
graft timescale/data
prune .github*
prune doc*
prune run*
prune test*
exclude *.cfg
exclude *.yml
include requirements.txt
include version.txt
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,29 @@ Development version from GitHub:
python3 -m pip install git+https://github.com/pyTMD/timescale.git
```

### Running with Pixi

Alternatively, you can use [Pixi](https://pixi.sh/) for a streamlined workspace environment:

1. Install Pixi following the [installation instructions](https://pixi.sh/latest/#installation)
2. Clone the project repository:

```bash
git clone https://github.com/pyTMD/timescale.git
```

3. Move into the `timescale` directory

```bash
cd timescale
```

4. Install dependencies and start a shell to run programs:

```bash
pixi shell
```

## Dependencies

- [dateutil: powerful extensions to datetime](https://dateutil.readthedocs.io/en/stable/)
Expand Down
22 changes: 0 additions & 22 deletions doc/environment.yml

This file was deleted.

8 changes: 7 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
# 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 os
import os
# import sys
import datetime
import warnings
# sys.path.insert(0, os.path.abspath('.'))
import importlib.metadata


# -- Project information -----------------------------------------------------
on_rtd = os.environ.get('READTHEDOCS') == 'True'

# package metadata
metadata = importlib.metadata.metadata("timescale")
Expand All @@ -31,6 +33,10 @@
# append "v" before the version
release = f"v{version}"

# suppress warnings in examples and documentation
if on_rtd:
warnings.filterwarnings("ignore")

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

# Add any Sphinx extension module names here, as strings. They can be
Expand Down
32 changes: 32 additions & 0 deletions doc/source/getting_started/Install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ The simplest installation for most users will likely be using ``conda`` or ``mam

conda update timescale

Development Install
###################

To use the development repository, please fork ``timescale`` into your own account and then clone onto your system:

.. code-block:: bash
Expand All @@ -36,3 +39,32 @@ The development version of ``timescale`` can also be installed directly from Git
.. code-block:: bash

python3 -m pip install --user git+https://github.com/pyTMD/timescale.git

Package Management with ``pixi``
################################

Alternatively ``pixi`` can be used to create a `streamlined environment <https://pixi.sh/>`_ after cloning the repository:

.. code-block:: bash

pixi install

``pixi`` maintains isolated environments for each project, allowing for different versions of
``timescale`` and its dependencies to be used without conflict. The ``pixi.lock`` file within the
repository defines the required packages and versions for the environment.

``pixi`` can also create shells for running programs within the environment:

.. code-block:: bash

pixi shell

To see the available tasks within the ``timescale`` workspace:

.. code-block:: bash

pixi task list

.. note::

``pixi`` is under active development and may change in future releases
23 changes: 18 additions & 5 deletions doc/source/project/Testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ Using the ``pytest`` command:

.. code-block:: bash

pytest --directory <path_to_tide_models> test/
pytest test/

Using ``pixi``:

.. code-block:: bash

pixi run test

The test suite is run in verbose mode as a default.

Expand All @@ -29,6 +35,10 @@ Coverage reports can be generated using the ``pytest-cov`` plugin (which is inst

pytest --cov timescale --cov-report=term

.. code-block:: bash

pixi run test "--cov ../timescale --cov-report=term"

Parallelization
^^^^^^^^^^^^^^^

Expand All @@ -37,17 +47,20 @@ To run in series and disable parallelization, set the number of processes to 0:

.. code-block:: bash

pytest --n 0
pytest -n 0

.. code-block:: bash

pixi run test "-n 0"

Continuous Integration
^^^^^^^^^^^^^^^^^^^^^^
We use `GitHub Actions <https://github.com/pyTMD/timescale/actions>`_ continuous integration (CI) services to build and test the project on Linux (Ubuntu) and Mac Operating Systems.
We use `GitHub Actions <https://github.com/pyTMD/timescale/actions>`_ continuous integration (CI) services to build and test the project on Linux (``ubuntu-latest``), Mac (``macos-latest``), and Windows (``windows-latest``) Operating Systems.
The configuration files for this service are in the `GitHub workflows <https://github.com/pyTMD/timescale/tree/main/.github/workflows>`_ directory.
The workflows use ``mamba`` and the `environment.yml <https://github.com/pyTMD/timescale/blob/main/environment.yml>`_ file to install the required dependencies and build the environment.
The workflows use ``pixi`` to install the required dependencies and build the custom environment.

The GitHub Actions jobs include:

* Updating `leap second <https://github.com/pyTMD/timescale/blob/main/timescale/data/leap-seconds.list>`_ and `delta time <https://github.com/pyTMD/timescale/blob/main/timescale/data/merged_deltat.list>`_ files
* Running `flake8 <https://flake8.pycqa.org/en/latest/>`_ to check the code for style and compilation errors
* Running the test suite on multiple combinations of OS and Python version
* Uploading source and wheel distributions to `PyPI <https://pypi.org/project/timescale/>`_ (on releases)
10 changes: 0 additions & 10 deletions environment.yml

This file was deleted.

Loading