diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ec689f0c1..a1a5cf73d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -13,7 +13,7 @@ "forwardPorts": [5432], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip install -r requirements.txt", + "postCreateCommand": "pip install -e .", // python scripts/tutorials/generate_database.py sqlite // python scripts/tutorials/generate_database.py postgres postgres://postgres@localhost:5432 diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index b9c1bf92d..075854726 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt + pip install .[test] - name: Test with pytest run: | diff --git a/.github/workflows/scheduled-tests.yml b/.github/workflows/scheduled-tests.yml index 40d53094d..b4a213208 100644 --- a/.github/workflows/scheduled-tests.yml +++ b/.github/workflows/scheduled-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt + pip install .[test] - name: Test with pytest run: | diff --git a/.gitignore b/.gitignore index eb9083205..8980eee45 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,7 @@ .ds_store *.code-workspace .ipynb_checkpoints - +*.egg-info +build/ +simple/version.py diff --git a/README.md b/README.md index 8cfa36ab6..89fce264d 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ We recommend using a conda environment to handle python dependencies. The follow ```bash conda create -n "simple-db" python=3.10 conda activate simple-db - pip install -r requirements.txt + pip install -e . ``` 3. In Python, connect a database file `SIMPLE.sqlite` as a Database object called `db` and recreate the database using the JSON files in the `data/` directory. Run these commands from within Python. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..092f5f8d3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[build-system] +requires = [ + "setuptools>=75", + "setuptools_scm", + ] +build-backend = "setuptools.build_meta" + + +[project] +name = "simple" +description = "SIMPLE Archive Software" +dynamic = ["version"] +readme = "README.md" +license = {file = "LICENSE"} +authors = [ + {name = "Kelle Cruz", email = "kellecruz@gmail.com"}, + {name = "David Rodriguez", email = "drodriguez@stsci.edu"}, +] +requires-python = ">= 3.10" +dependencies = [ + "astrodbkit", + "astrodb_utils", + "ads", + "matplotlib", +] + +[project.optional-dependencies] +test = [ + "pytest", +] + +[project.urls] +Repository = "https://github.com/SIMPLE-AstroDB/SIMPLE-db" +Documentation = "https://github.com/SIMPLE-AstroDB/SIMPLE-db/documentation" + + +[tool.setuptools] +packages = ["simple"] + +[tool.setuptools_scm] +write_to = "simple/version.py" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 21a111600..000000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -pytest -ads -matplotlib -astrodbkit -astrodb_utils \ No newline at end of file diff --git a/simple/__init__.py b/simple/__init__.py index e69de29bb..43efbbb57 100644 --- a/simple/__init__.py +++ b/simple/__init__.py @@ -0,0 +1,3 @@ +from .version import version as __version__ + +__all__ = ["__version__"]