Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

137 setuptools is not installing requirements properly #138

Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1931de8
attempt to shift from setuptools to poetry
emlynjdavies Sep 21, 2023
f56ce5e
Update environment.yml
emlynjdavies Sep 21, 2023
2b4507f
Update windows-build-and-test.yml
emlynjdavies Sep 21, 2023
1ba903d
Update windows-build-and-test.yml
emlynjdavies Sep 21, 2023
63e4686
Update windows-build-and-test.yml
emlynjdavies Sep 21, 2023
fdb77b4
Update windows-build-and-test.yml
emlynjdavies Sep 21, 2023
3118290
add poetry.lock
emlynjdavies Sep 21, 2023
ef04cb7
Update windows-build-and-test.yml
emlynjdavies Sep 21, 2023
0908f5d
Update windows-build-and-test.yml
emlynjdavies Sep 21, 2023
45941f5
try with updated tensorflow
emlynjdavies Sep 21, 2023
301d89a
try with updated tensorflow
emlynjdavies Sep 21, 2023
161dc74
include setuptools
emlynjdavies Sep 21, 2023
e7b46e4
try pip for windows test
emlynjdavies Sep 21, 2023
513c3fd
Update pyproject.toml
emlynjdavies Sep 21, 2023
0f67162
delete lock file
emlynjdavies Sep 21, 2023
6d6a607
Update pyproject.toml
emlynjdavies Sep 21, 2023
02f321e
remove tensorflow-io-gcs-filesystem
emlynjdavies Sep 22, 2023
8d7fc21
Update windows-build-and-test.yml
emlynjdavies Sep 22, 2023
ce67c7f
Update windows-build-and-test.yml
emlynjdavies Sep 22, 2023
d65bc24
update
emlynjdavies Sep 22, 2023
1a3ddaf
updatae
emlynjdavies Sep 22, 2023
39dbd99
remove python from env and manage by poetry instead
emlynjdavies Sep 23, 2023
0f6ee4a
Update process.py
emlynjdavies Sep 23, 2023
4b00657
force failure in tests
emlynjdavies Sep 23, 2023
c88004d
add old windows to tests
emlynjdavies Sep 23, 2023
b1efbec
attempt pip
emlynjdavies Sep 23, 2023
e7d503e
Update windows-build-and-test.yml
emlynjdavies Sep 23, 2023
4f5b3b1
Update windows-build-and-test.yml
emlynjdavies Sep 23, 2023
2472639
attempt pip install
emlynjdavies Sep 23, 2023
3fec62c
windows pip test. ubuntu poetry test. auto version from init
emlynjdavies Sep 23, 2023
9c8d7b0
Merge branch '129-make-high-level-admin-cmd-line-entry-points' into 1…
emlynjdavies Sep 23, 2023
2ffaddd
Update README.md
emlynjdavies Sep 23, 2023
23f4628
Update build-and-test.yml
emlynjdavies Sep 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 26 additions & 14 deletions .github/workflows/windows-build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
name: Windows build and test
name: Build and test

emlynjdavies marked this conversation as resolved.
Show resolved Hide resolved
on: [pull_request]

env:
IMAGE_NAME: sintef/pyopia
IMAGE_TAG: github-ci
on: [push, pull_request]

jobs:
build:
runs-on: windows-2019
Windows_pip:
runs-on: windows-latest
timeout-minutes: 60

steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v2

- name: Install pyopia environment
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Setup install
run: python setup.py install
- name: Install pyopia
run: pip install ./

- name: Test
run: python -m pytest -v
Ubuntu_poetry:
runs-on: ubuntu-latest
timeout-minutes: 60

- name: Setup test
run: python setup.py test
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: poetry install
- name: Run the automated tests
run: poetry run pytest -v
23 changes: 7 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,38 +81,29 @@ cd pyopia-main

For the next steps, you need to be located in the directory that contains the file 'environment.yml'.

2. Create a virtual environment using the environment.yml (will create an environment called pyopia):
1. (optional, but recommended) Create a virtual environment using the environment.yml. This will create an environment called pyopia, but with no dependencies installed. Dependencies are managed by poetry (in step 2):
emlynjdavies marked this conversation as resolved.
Show resolved Hide resolved

```bash
conda env create -f environment.yml
```

3. To update, we recommend a forced re-install:

```bash
conda env create -f environment.yml --force
```

(but you could also try this, which might be quicker but a less reliable form of updating):
and activate the environment:

```bash
conda env update --file environment.yml --prune
conda activate pyopia
```

4. To activate:
2. Install dependencies using poetry:

```bash
conda activate pyopia
poetry install
```

5. Test that it works with:
3. (optional) Run local tests:

```bash
python setup.py develop
poetry run pytest
```

Note that `pip install` or `python setup.py install` will probably cause you problems if you want to develop the code, and should only be used for deployment purposes.

----
# License

Expand Down
24 changes: 12 additions & 12 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
flake8
docopt
setuptools
pytest-error-for-skips
sphinx_rtd_theme>=0.5.0
sphinxcontrib-napoleon>=0.7
sphinx-togglebutton
sphinx-copybutton
readthedocs-sphinx-search
myst-nb
jupyter_book
ipykernel>=6.19.4
flake8
docopt
setuptools
pytest-error-for-skips
sphinx_rtd_theme>=0.5.0
sphinxcontrib-napoleon>=0.7
sphinx-togglebutton
sphinx-copybutton
readthedocs-sphinx-search
myst-nb
jupyter_book
ipykernel>=6.19.4
3 changes: 1 addition & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ name: pyopia
channels:
- conda-forge
dependencies:
- python=3.10
- pip
- poetry
4,209 changes: 4,209 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

51 changes: 49 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,51 @@
[tool.poetry]
name = "pyopia"
version = "0"
description = "A Python Ocean Particle Image Analysis toolbox."
authors = ["Emlyn Davies <emlyn.davies@sintef.no>"]
readme = "README.md"
packages = [{include = "pyopia"}]

[tool.poetry.dependencies]
emlynjdavies marked this conversation as resolved.
Show resolved Hide resolved
python = ">=3.10,<3.12"
flake8 = "^6.1.0"
numpy = "^1.24.0"
pandas = {version = ">=2.1", extras = ["computation", "hdf5"]}
h5py = "^3.9.0"
scipy = "^1.11.2"
scikit-image = "^0.21.0"
pytest = ">=7.2.0"
imageio = "^2.31.3"
matplotlib = ">=3.7"
tqdm = "^4.66.1"
pytest-error-for-skips = "^2.0.2"
nbclient = "0.7"
sphinx = "5.0"
sphinx-rtd-theme = ">=0.5.0"
sphinxcontrib-napoleon = ">=0.7"
sphinx-togglebutton = "^0.3.2"
sphinx-copybutton = "^0.5.2"
readthedocs-sphinx-search = "^0.3.1"
myst-nb = "^0.17.2"
jupyter-book = "^0.15.1"
ipykernel = ">=6.19.4"
urllib3 = "<2.0"
gdown = "^4.7.1"
cmocean = "^3.0.3"
toml = "^0.10.2"
xarray = "^2023.8.0"
typer = {extras = ["all"], version = "^0.9.0"}
tensorflow-io-gcs-filesystem = "0.31.0"
tensorflow-cpu = "^2.13.0"

[tool.poetry-version-plugin]
source = "init"

[tool.poetry.scripts]
pyopia = "pyopia.cli:app"

[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.setuptools_scm]
29 changes: 0 additions & 29 deletions requirements.txt

This file was deleted.

17 changes: 0 additions & 17 deletions setup.cfg

This file was deleted.

85 changes: 0 additions & 85 deletions setup.py

This file was deleted.