Skip to content

Commit

Permalink
Merge branch 'main' of github.com:NREL/altrios
Browse files Browse the repository at this point in the history
# Conflicts:
#	pyproject.toml
  • Loading branch information
calbaker committed Jul 12, 2023
2 parents c059865 + a14e985 commit 7c61300
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10']

env:
PYTHON: ${{ matrix.python-version }}
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
- macos
- windows
python-version:
- "8"
- "9"
- "10"
include:
Expand All @@ -31,7 +30,7 @@ jobs:
- name: set up python
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.9"

- name: set up rust
if: matrix.os != 'ubuntu'
Expand All @@ -55,7 +54,7 @@ jobs:
run: pip install -U maturin wheel twine cibuildwheel

- name: build sdist
if: matrix.os == 'ubuntu' && matrix.python-version == '8'
if: matrix.os == 'ubuntu' && matrix.python-version == '9'
run: |
pip install -U maturin
maturin build --sdist --out dist/
Expand All @@ -69,8 +68,6 @@ jobs:
CIBW_TEST_COMMAND: "pytest {project}/tests -s"
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH"'
CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"'
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_I686_IMAGE: "manylinux2014"
CIBW_ARCHS_MACOS: 'universal2'
# see https://cibuildwheel.readthedocs.io/en/stable/faq/#universal2
CIBW_TEST_SKIP: '*_universal2:arm64'
Expand All @@ -92,6 +89,11 @@ jobs:
upload:
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/altrios
permissions:
id-token: write
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
Expand All @@ -101,6 +103,3 @@ jobs:

- name: publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Altrios Logo](https://raw.githubusercontent.com/NREL/altrios/main/.github/images/ALTRIOS-logo-web.jpg)

[![Tests](https://github.com/NREL/altrios/actions/workflows/tests.yaml/badge.svg)](https://github.com/NREL/altrios/actions/workflows/tests.yaml) [![wheels](https://github.com/NREL/altrios/actions/workflows/wheels.yaml/badge.svg)](https://github.com/NREL/altrios/actions/workflows/wheels.yaml) ![Release](https://img.shields.io/badge/release-v0.1.0-blue) ![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue)
[![Tests](https://github.com/NREL/altrios/actions/workflows/tests.yaml/badge.svg)](https://github.com/NREL/altrios/actions/workflows/tests.yaml) [![wheels](https://github.com/NREL/altrios/actions/workflows/wheels.yaml/badge.svg)](https://github.com/NREL/altrios/actions/workflows/wheels.yaml) ![Release](https://img.shields.io/badge/release-v0.1.0-blue) ![Python](https://img.shields.io/badge/python-3.9%20%7C%203.10-blue)

![Model Framework Schematic](https://raw.githubusercontent.com/NREL/altrios/main/.github/images/ALTRIOS_schematic_Alfred_Hicks.png)

Expand All @@ -17,7 +17,7 @@ The Advanced Locomotive Technology and Rail Infrastructure Optimization System (
1. Python installation options:
- Option 1 -- Python: https://www.python.org/downloads/. We recommend Python 3.10. Be sure to check the `Add to PATH` option during installation.
- Option 2 -- Anaconda: we recommend https://docs.conda.io/en/latest/miniconda.html.
1. Setup a python environment. ALTRIOS can work with Python 3.8, 3.9, or 3.10, but we recommend 3.10 for better performance and user experience. Create a python environment for ALTRIOS with either of two methods:
1. Setup a python environment. ALTRIOS can work with Python 3.9, or 3.10, but we recommend 3.10 for better performance and user experience. Create a python environment for ALTRIOS with either of two methods:
- Option 1 -- [Python Venv](https://docs.python.org/3/library/venv.html)
1. Navigate to the ALTRIOS folder you just cloned or any folder you'd like for using ALTRIOS. Remember the folder you use!
1. Assuming you have Python 3.10 installed, run `python3.10 -m venv altrios-venv` in your terminal enviroment (we recommend PowerShell in Windows, which comes pre-installed). This tells Python 3.10 to use the `venv` module to create a virtual environment (which will be ignored by git if named `altrios-venv`) in the `ALTRIOS/altrios-venv/`.
Expand Down
1 change: 0 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[mypy]
ignore_missing_imports = True
python_version = 3.8
warn_return_any = True
warn_unused_configs = True

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["maturin>=0.15,<0.16"]
requires = ["maturin>=1.0"]
build-backend = "maturin"

[project]
Expand All @@ -21,7 +21,7 @@ authors = [
]
description = "Tool for modeling and optimization of advanced locomotive powertrains for freight rail decarbonization."
readme = "README.md"
requires-python = ">=3.8, <3.11"
requires-python = ">=3.9, <3.11"
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: POSIX",
Expand Down Expand Up @@ -50,6 +50,7 @@ dev = ["black", "pytest", "maturin", "ipykernel"]
Homepage = "https://www.nrel.gov/transportation/altrios.html"

[tool.maturin]
profile="release"
python-source="python"
features = ["pyo3/extension-module"]
module-name = "altrios.altrios_core_py"
Expand Down

0 comments on commit 7c61300

Please sign in to comment.