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

Packaging updates #102

Merged
merged 11 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install pypa/build
Expand Down
26 changes: 3 additions & 23 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
DISPLAY: ':99.0'
QT_MAC_WANTS_LAYER: 1 # PyQT gui tests involving qtbot interaction on macOS will fail without this
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Miniforge
uses: conda-incubator/setup-miniconda@v3
Expand All @@ -37,26 +37,6 @@ jobs:
activate-environment: badger-dev
use-mamba: true
python-version: ${{ matrix.python-version }}
environment-file: env/environment.yml

# Have to install pyqt5 with pip
- name: Install pyqt5
shell: bash -el {0}
run: |
pip install PyQt5

- name: Update environment
# Mainly need Xopt
# TODO: evaluate need for this env file
shell: bash -l {0}
run: |
mamba install -n badger-dev python=${{ matrix.python-version }}

- name: Install python packages
# Qt related packages after pyqt5 is installed
shell: bash -el {0}
run: |
mamba install --file env/requirements.txt

- name: Install libs for testing a pyqt app on linux
shell: bash -el {0}
Expand All @@ -72,7 +52,7 @@ jobs:
- name: Install Badger
shell: bash -l {0}
run: |
pip install .
pip install ".[dev]"

- name: Run Tests
shell: bash -l {0}
Expand All @@ -86,7 +66,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install pypa/build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ __pycache__
*.pickle
*.db
.vscode
src/badger/_version.py
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include versioneer.py
include src/badger/_version.py
include src/badger/gui/default/images/*.png
graft src/badger/tests
Expand Down
12 changes: 0 additions & 12 deletions env/environment.yml

This file was deleted.

8 changes: 0 additions & 8 deletions env/requirements.txt

This file was deleted.

6 changes: 0 additions & 6 deletions env/windows-dev-requirements.txt

This file was deleted.

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

[project]
name = "badger-opt"
description = "Interface for optimization of arbitrary problems in Python."
readme = "README.md"
authors = [
{ name = "Zhe Zhang", email = "[email protected]" },
]
keywords = ["optimization", "machine learning", "GUI"]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Natural Language :: English",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
]
requires-python = ">=3.9"
dependencies = [
"pandas",
"pyyaml",
"coolname",
"pyqt5",
"pyqtgraph",
"qdarkstyle",
"pillow",
"requests",
"tqdm",
"xopt"
]
dynamic = ["version"]
[tool.setuptools_scm]
version_file = "src/badger/_version.py"

[project.optional-dependencies]
dev = [
"pytest",
"pytest-cov",
"pytest-qt",
"pytest-mock"
]

[project.urls]
Homepage = "https://github.com/xopt-org/Badger"
Documentation = "https://xopt-org.github.io/Badger/"
"Bug Tracker" = "https://github.com/xopt-org/Badger/issues"

[project.scripts]
badger = "badger.__main__:main"

[project.license]
file = "LICENSE"

[options]
zip_safe = false
include_package_data = true

[tool.setuptools.packages.find]
where = ["src"]
include = [ "badger", ]
namespaces = false

[tool.ruff]
# select = []
YektaY marked this conversation as resolved.
Show resolved Hide resolved
# ignore = []

[tool.pytest.ini_options]
addopts = "--cov=badger/"
log_cli_level = "info"
log_level = "debug"
testpaths = ["src/badger/tests"]
6 changes: 0 additions & 6 deletions setup.cfg

This file was deleted.

41 changes: 0 additions & 41 deletions setup.py

This file was deleted.

6 changes: 5 additions & 1 deletion src/badger/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
from . import _version
__version__ = _version.get_versions()['version']

try:
from ._version import __version__
except ImportError:
__version__ = "0.0.0"
Loading