diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 03df769..7beb875 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,5 +1,3 @@ -# This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries name: Upload geneal to Pypi @@ -8,41 +6,47 @@ on: types: [published] jobs: - deploy: + build: + name: Build project distribution 📦 + runs-on: ubuntu-latest + env: + POETRY_VIRTUALENVS_CREATE: "false" + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.8" + - name: Install poetry + run: | + pipx install poetry + poetry self add poetry-bumpversion + - name: Build + run: | + poetry version ${{ github.ref_name }} + poetry build + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + publish-to-pypi: + name: Publish stratestic 📦 to PyPI + needs: + - build runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/stratestic + permissions: + id-token: write steps: - - uses: actions/checkout@v2 - - name: Change Pypi version - run: | - python ./scripts/update_version.py - - name: Commit files - env: - CI_USER: ${{ secrets.USERNAME }} - CI_EMAIL: ${{ secrets.EMAIL }} - run: | - git config --local user.email "$CI_EMAIL" - git config --local user.name "$CI_USER" - git commit -a -m "Update version.txt" - - name: Push code to master - env: - CI_USER: ${{ secrets.USERNAME }} - CI_EMAIL: ${{ secrets.EMAIL }} - GITHUB_REPOSITORY: ${{ secrets.REPOSITORY }} - run: git push "https://$CI_USER:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:master - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist - twine upload dist/* + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/license.txt b/license.txt index 8df1494..9b7752b 100644 --- a/license.txt +++ b/license.txt @@ -1,4 +1,4 @@ -Copyright 2020 Diogo Matos Chaves +Copyright 2024 Diogo Matos Chaves Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without diff --git a/poetry.lock b/poetry.lock index d8d7e7d..e71dd87 100644 --- a/poetry.lock +++ b/poetry.lock @@ -22,9 +22,6 @@ files = [ {file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"}, ] -[package.dependencies] -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} - [package.extras] cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] dev = ["attrs[tests]", "pre-commit"] @@ -350,7 +347,6 @@ files = [ ] [package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} zipp = ">=0.5" [package.extras] @@ -482,11 +478,9 @@ files = [ [package.dependencies] attrs = ">=17.4.0" -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} importlib-resources = {version = ">=1.4.0", markers = "python_version < \"3.9\""} pkgutil-resolve-name = {version = ">=1.3.10", markers = "python_version < \"3.9\""} pyrsistent = ">=0.14.0,<0.17.0 || >0.17.0,<0.17.1 || >0.17.1,<0.17.2 || >0.17.2" -typing-extensions = {version = "*", markers = "python_version < \"3.8\""} [package.extras] format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] @@ -647,9 +641,6 @@ files = [ {file = "kiwisolver-1.4.5.tar.gz", hash = "sha256:e57e563a57fb22a142da34f38acc2fc1a5c864bc29ca1517a88abc963e60d6ec"}, ] -[package.dependencies] -typing-extensions = {version = "*", markers = "python_version < \"3.8\""} - [[package]] name = "llvmlite" version = "0.39.1" @@ -768,7 +759,6 @@ files = [ [package.dependencies] fastjsonschema = "*" -importlib-metadata = {version = ">=3.6", markers = "python_version < \"3.8\""} jsonschema = ">=2.6" jupyter-core = "*" traitlets = ">=5.1" @@ -1078,16 +1068,17 @@ files = [ [[package]] name = "plotly" -version = "5.10.0" +version = "5.18.0" description = "An open-source, interactive data visualization library for Python" optional = false python-versions = ">=3.6" files = [ - {file = "plotly-5.10.0-py2.py3-none-any.whl", hash = "sha256:989b13825cc974390aa0169479485d9257d37848a47bc63957251f8e1a7046ba"}, - {file = "plotly-5.10.0.tar.gz", hash = "sha256:4d36d9859b7a153b273562deeed8c292587a472eb1fd57cd4158ec89d9defadb"}, + {file = "plotly-5.18.0-py3-none-any.whl", hash = "sha256:23aa8ea2f4fb364a20d34ad38235524bd9d691bf5299e800bca608c31e8db8de"}, + {file = "plotly-5.18.0.tar.gz", hash = "sha256:360a31e6fbb49d12b007036eb6929521343d6bee2236f8459915821baefa2cbb"}, ] [package.dependencies] +packaging = "*" tenacity = ">=6.2.0" [[package]] @@ -1101,9 +1092,6 @@ files = [ {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, ] -[package.dependencies] -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} - [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] @@ -1251,7 +1239,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" @@ -1575,17 +1562,6 @@ files = [ docs = ["myst-parser", "pydata-sphinx-theme", "sphinx"] test = ["argcomplete (>=2.0)", "pre-commit", "pytest", "pytest-mock"] -[[package]] -name = "typing-extensions" -version = "4.7.1" -description = "Backported and Experimental Type Hints for Python 3.7+" -optional = false -python-versions = ">=3.7" -files = [ - {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, - {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, -] - [[package]] name = "wcwidth" version = "0.2.13" @@ -1614,5 +1590,5 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" -python-versions = ">=3.7.1,<3.11" -content-hash = "be954672af89c988254a05db9828744bb0211ce465151cdf2c0b09695b2b174f" +python-versions = ">=3.8,<3.11" +content-hash = "57b0c8445e7516c31d37dfdb40c62970030f286e8e054290639ac423533ec28c" diff --git a/pyproject.toml b/pyproject.toml index 1cf238b..a6c04cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,15 @@ [tool.poetry] -name = "genetic-algorithm" -version = "0.4.1" -description = "Python Genetic Algorithms library" -authors = ["Diogo Matos Chaves "] +name = "geneal" +version = "0.5.1" +description = "Python Genetic Algorithm library" license = "MIT License" +authors = ["Diogo Matos Chaves "] +readme = "README.md" +repository = "https://github.com/diogomatoschaves/geneal" +keywords = ["genetic algorithms", "ga", "optimization", "genetic programming"] [tool.poetry.dependencies] -python = ">=3.7.1,<3.11" +python = ">=3.8,<3.11" numpy = "1.21.6" matplotlib = "3.5.3" numba = "0.56.2" @@ -15,7 +18,7 @@ networkx = "2.6.3" pandas = "1.3.5" descartes = "1.1.0" ipykernel = "6.16.0" -plotly = "5.10.0" +plotly = "^5.10.0" nbformat = "5.6.1" [tool.poetry.dev-dependencies] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 7cc4d3b..0000000 --- a/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[metadata] -name = geneal -description-file = README.md -license = MIT license -keywords = genetic algorithms, ga, optimization, genetic programming diff --git a/setup.py b/setup.py deleted file mode 100644 index 98d1327..0000000 --- a/setup.py +++ /dev/null @@ -1,32 +0,0 @@ -import os -from setuptools import setup, find_packages - -with open("README.md", "r") as fh: - long_description = fh.read() - -try: - __version__ = os.environ["GITHUB_REF"].split("/")[-1] - print(f"Version: {__version__}") -except KeyError: - from geneal.version import __version__ - -setup( - name="geneal", - version=__version__, - description="Python Genetic Algorithms library", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/diogomatoschaves/geneal", - author="Diogo Matos Chaves", - author_email="di.matoschaves@gmail.com", - packages=[*find_packages(), "geneal.utils"], - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], - python_requires=">=3.5", - install_requires=["numpy", "matplotlib", "scipy", "networkx", "pandas"], - test_requires=["pytest", "pytest-cov", "pytest-mock"], - keywords=["genetic algorithms", "ga", "optimization", "genetic programming"], -)