Skip to content

Commit

Permalink
Merge pull request #86 from VegeWaterDynamics/fix_dependecies
Browse files Browse the repository at this point in the history
Fix dependecies
  • Loading branch information
SarahAlidoost authored Nov 10, 2023
2 parents ca51ea3 + 33c8c25 commit 269fbdc
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 118 deletions.
33 changes: 12 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,28 @@
name: Build
name: Build and test Python package

on: [push, pull_request]

jobs:

build:
name: Build for ${{ matrix.python-version }}
runs-on: 'ubuntu-latest'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10']
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.10', '3.11']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Python info
shell: bash -l {0}
run: |
which python
python --version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build
shell: bash -l {0}
run: |
python setup.py build
- name: Test
shell: bash -l {0}
run: |
pip install pytest pytest-cov pycodestyle
pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml
python -m pip install build
python -m pip install .[dev]
- name: Build the package
run: python -m build
- name: Run tests
run: pytest tests/
18 changes: 0 additions & 18 deletions environment.yml

This file was deleted.

105 changes: 105 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "motrainer"
version = "0.1.0"
requires-python = ">=3.10, <3.12"
dependencies = [
"dask[complete]",
"ipykernel",
"numpy<1.24.0",
"pandas==2.0.3",
"scikit-learn",
"scikit-optimize",
"scipy",
"tensorflow",
"xarray",
"zarr",
]
description = "Machine Learning module to train a surrogate module using Land-surface model output"
readme = "README.rst"
license = {file = "LICENSE"}
authors = [
{name = "Ou Ku", email = "[email protected]"},
{name = "Fakhereh Sarah Alidoost"},
{name = "Pranav Chandramouli"},
{name = "Francesco Nattino"},
{name = "Meiert Willem Grootes"},
{name = "Xu Shan"},
{name = "Sonja Georgievska"},
{name = "Susan Steele-Dunne"},
]
keywords = ["machine learning", "earth observation", "data assimilations", "training", "sensor"]
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
]

[project.urls]
repository = "https://github.com/VegeWaterDynamics/motrainer"
doi = "https://zenodo.org/doi/10.5281/zenodo.7540442"
documentation = "https://VegeWaterDynamics.github.io/motrainer/"
changelog = "https://VegeWaterDynamics.github.io/motrainer/CHANGELOG/"

[project.optional-dependencies]
dev = [
"pytest",
"pytest-cov",
"pycodestyle",
"ruff",
]
docs = [
"mkdocs",
"mkdocs-material",
"mkdocs-jupyter",
"mkdocstrings[python]",
"mkdocs-gen-files",
]
demo = [
"jupyterlab",
"matplotlib",
]

[tool.setuptools]
packages = ["motrainer"]

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--cov --cov-report term"
testpaths = [
"tests",
]

[tool.coverage.run]
branch = true
source = ["motrainer"]

[tool.ruff]
select = [
"E", # pycodestyle
"F", # pyflakes
"B", # flake8-bugbear
"D", # pydocstyle
"I", # isort
"N", # PEP8-naming
"UP", # pyupgrade (upgrade syntax to current syntax)
"PLE", # Pylint error https://github.com/charliermarsh/ruff#error-ple
]
ignore = [
"D100", "D101", "D104", "D105", "D106", "D107", "D203", "D213"
] # docstring style

line-length = 88
exclude = ["docs", "build"]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
target-version = "py310"

[tool.ruff.per-file-ignores]
"tests/**" = ["D"]
11 changes: 0 additions & 11 deletions requirements.txt

This file was deleted.

20 changes: 0 additions & 20 deletions setup.cfg

This file was deleted.

51 changes: 3 additions & 48 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,50 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup

# To update the package version number, edit CITATION.cff
with open('CITATION.cff', 'r') as cff:
for line in cff:
if 'version:' in line:
version = line.replace('version:', '').strip().strip('"')
"""The setup script."""

with open('README.rst') as readme_file:
readme = readme_file.read()

with open('requirements.txt') as requirements_file:
requirements = requirements_file.read().split()
from setuptools import setup

setup(
name='motrainer',
version=version,
description="Machine Learning module to train a surrogate module using Land-surface model dtput",
long_description=readme + '\n\n',
author="Netherlands eScience Center, TUDelft",
author_email='[email protected]',
url='https://github.com/VegeWaterDynamics/motrainer',
packages=[
'motrainer',
],
include_package_data=True,
license="Apache Software License 2.0",
zip_safe=False,
keywords='motrainer',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
test_suite='tests',
install_requires=requirements,
tests_require=[
'pytest',
'pytest-cov',
'pycodestyle',
],
data_files=[('citation/motrainer', ['CITATION.cff'])]
)
setup()

0 comments on commit 269fbdc

Please sign in to comment.