Skip to content

Commit

Permalink
brought tests dir from brahmap/ to root; updated github workflow for …
Browse files Browse the repository at this point in the history
…pytest; updated package discovery in pyproject.toml
  • Loading branch information
anand-avinash committed Mar 12, 2024
1 parent 169c39a commit ee8db1d
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 6 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
### Running pytest

name: BrahMap testing
on:
push:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install BrahMap
run: |
python -m pip install --upgrade pip
python -m pip install .
- name: Test BrahMap with pytest
run: |
pytest
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
recursive-include extern *
recursive-include tests *
global-exclude */__pycache__/*
global-exclude *.pyc
global-exclude */.pytest_cache/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ for a completer reference to `BrahMap` API.

```shell
# Clone the repository
git clone https://github.com/anand-avinash/BrahMap.git
git clone --recursive https://github.com/anand-avinash/BrahMap.git

cd BrahMap

Expand Down
Empty file added brahmap/src/__init__.py
Empty file.
10 changes: 8 additions & 2 deletions brahmap/utilities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@
)

from .process_ces import ProcessTimeSamples
from .lbsim_interface import lbs_process_timesamples

from importlib.util import find_spec

# suggestion taken from: <https://docs.astral.sh/ruff/rules/unused-import/>
if find_spec("litebird_sim") is not None:
import_str = "lbs_process_timesamples"
else:
import_str = None

__all__ = [
"is_sorted",
Expand All @@ -36,5 +42,5 @@
"subscan_resize",
"system_setup",
"ProcessTimeSamples",
"lbs_process_timesamples",
import_str,
]
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ for a completer reference to `BrahMap` API.

```shell
# Clone the repository
git clone https://github.com/anand-avinash/BrahMap.git
git clone --recursive https://github.com/anand-avinash/BrahMap.git

cd BrahMap

Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ requires-python = ">=3.9,<3.13"
dependencies = [
"numpy",
"scipy",
"healpy",
"krypy",
"ruff",
"pre-commit",
Expand All @@ -32,8 +33,10 @@ Documentation = "https://anand-avinash.github.io/BrahMap/"
Issues = "https://github.com/anand-avinash/BrahMap/issues"
# Changelog =

[tool.setuptools]
packages = ["brahmap"]
[tool.setuptools.packages.find]
where = ["."]
include = ["brahmap*"]
namespaces = false

[tool.pytest.ini_options]
norecursedirs = ["extern"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ee8db1d

Please sign in to comment.