From 10e5a6d5695e823aa95666e638e0e9037702e40e Mon Sep 17 00:00:00 2001 From: Konstantinos Kavvadias Date: Mon, 5 Feb 2024 21:58:19 +0200 Subject: [PATCH] Updates on requirements packaging, publishing, CI/CD --- .github/workflows/publish.yml | 29 +++++++++++++++++++ .../{pythonpackage.yml => tests.yml} | 5 +++- MANIFEST.in | 2 +- binder/environment.yml | 6 ++-- environment.yml | 2 +- setup.cfg | 6 ++-- setup.py | 2 ++ 7 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/publish.yml rename .github/workflows/{pythonpackage.yml => tests.yml} (96%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..286efc8 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,29 @@ +# Build the package and publish it to PyPI after tests pass. +name: Publish to PyPI +on: + release: + types: ["published"] + +jobs: + tests: + uses: ./.github/workflows/tests.yml + publish: + name: publish + needs: [tests] # require tests to pass before deploy runs + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v4 + - name: Set up Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: 3.9 + - name: Build package + run: | + python -m pip install -U pip build + python -m build + - name: Publish + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_KEY }} \ No newline at end of file diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/tests.yml similarity index 96% rename from .github/workflows/pythonpackage.yml rename to .github/workflows/tests.yml index 5d406c1..2f7772d 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,9 @@ name: enlopy-tests -on: [push] +on: + push: + pull_request: + workflow_call: jobs: build: diff --git a/MANIFEST.in b/MANIFEST.in index 56e757b..dc68cfe 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include *.rst *.txt *.yml LICENSE .travis.yml \ No newline at end of file +include *.rst *.txt *.yml LICENSE \ No newline at end of file diff --git a/binder/environment.yml b/binder/environment.yml index b9de085..2c4f09a 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -3,10 +3,10 @@ channels: - conda-forge - defaults dependencies: - - python=3.7 + - python=3.11 - numpy>=1.12 - matplotlib>=2.0 - - pandas>=0.22 - - scipy>=1.0 + - pandas>=2.0 + - scipy>=1.10 - enlopy - rise \ No newline at end of file diff --git a/environment.yml b/environment.yml index 282d19f..031a2dd 100644 --- a/environment.yml +++ b/environment.yml @@ -1,6 +1,6 @@ name: enlopy dependencies: - - python=3.9 + - python=3.11 - numpy>=1.10 - scipy>=1.10 - matplotlib>=2.0 diff --git a/setup.cfg b/setup.cfg index 48c4a71..19b9527 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [bdist_wheel] -universal = 1 +universal = 0 [metadata] -license_file = LICENSE -description-file = README.rst \ No newline at end of file +license_files = LICENSE +description_file = README.rst \ No newline at end of file diff --git a/setup.py b/setup.py index 6a866f9..eab3d49 100644 --- a/setup.py +++ b/setup.py @@ -40,6 +40,7 @@ def find_version(*file_paths): long_description=read('README.rst'), license="BSD-3-Clause", version=find_version("enlopy", "__init__.py"), + python_requires = ">=3.9", install_requires=requirements, keywords=['energy','timeseries','statistics','profile','demand'], packages=find_packages(), @@ -68,6 +69,7 @@ def find_version(*file_paths): 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', # distclass=distutils.command.bdist_conda.CondaDistribution, # conda_buildnum=1,