Skip to content

Commit 8583728

Browse files
authored
Merge pull request #31 from open-lasso-python/release/2.0.0rc1
Release Candidate 1 for Version 2
2 parents 55b8072 + f3d67df commit 8583728

File tree

175 files changed

+29949
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+29949
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: "✨ Feature request"
3+
about: Suggest an idea for this project.
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: "\U0001F308 Generic Ticket"
3+
about: Anything not being a bug report or a feature.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: "\U0001F41B Bug report"
3+
about: Create a report to help us fix a software bug.
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**🐛 Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**🔢 To Reproduce**
14+
Steps to reproduce the behavior:
15+
16+
1. Use file '...'
17+
2. Run '...'
18+
3. See error
19+
20+
**💘 Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**📷 Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**🖥️ Setup**
27+
- lasso-python version: [e.g. 1.5.1]
28+
- OS: [e.g. iOS]
29+
30+
**ℹ️ Additional context**
31+
Add any other context about the problem here.

.github/workflows/ci-cd.yml

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
name: Python Linting, Test and Upload
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
# JOB
10+
# This job runs unit tests, linting and format checks
11+
tests:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
# If either the tests for 3.8 or 3.10 fail all workflows
16+
# are terminated to safe computing resources.
17+
fail-fast: true
18+
# To safe runtime least and latest version supported are
19+
# chosen. We go for 3.8 due to some dependencies. For more
20+
# info see the pyproject.toml
21+
matrix:
22+
python-version: ["3.8", "3.10"]
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install Task
33+
run: |
34+
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
35+
36+
# Cache dependencies from poetry to speed things up
37+
- name: Load cached venv
38+
id: cached-poetry-dependencies
39+
uses: actions/cache@v3
40+
with:
41+
path: .venv
42+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
43+
44+
- name: Install and upgrade pip and poetry
45+
run: python -m pip install --upgrade pip poetry
46+
47+
- name: Install Dependencies
48+
run: ./bin/task setup
49+
50+
- name: Lint code
51+
run: ./bin/task lint
52+
53+
- name: Test code
54+
run: ./bin/task test
55+
56+
# JOB
57+
# This job publishes the package to test-pipy.
58+
test-publish:
59+
# Will run after the job 'tests'
60+
needs: [tests]
61+
62+
if: >
63+
startsWith(github.ref, 'refs/tags/') ||
64+
startsWith(github.ref, 'refs/heads/release/')
65+
runs-on: ubuntu-latest
66+
# Required for installation of the test package in the
67+
# next job.
68+
outputs:
69+
version: ${{ steps.extract_version.outputs.version }}
70+
71+
steps:
72+
- uses: actions/checkout@v3
73+
74+
- name: Remember version
75+
id: extract_version
76+
run: |
77+
VERSION=$(cat pyproject.toml | grep -oE -m 1 "version = \"(.*)\"" | cut -f2 -d '"')
78+
echo "Version: ${VERSION}"
79+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
80+
81+
# For publishing any version will do
82+
- name: Set up Python 3.10
83+
uses: actions/setup-python@v4
84+
with:
85+
python-version: "3.10"
86+
87+
- name: Install Task
88+
run: |
89+
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
90+
91+
- name: Load cached venv
92+
id: cached-poetry-dependencies
93+
uses: actions/cache@v3
94+
with:
95+
path: .venv
96+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
97+
98+
- name: Install Dependencies
99+
run: |
100+
python -m pip install --upgrade pip poetry
101+
./bin/task setup
102+
103+
- name: Build packages for release
104+
run: ./bin/task build
105+
106+
- name: Publish distribution to Test PyPI
107+
env:
108+
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
109+
TWINE_USERNAME: __token__
110+
TWINE_NON_INTERACTIVE: 1
111+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
112+
run: poetry run twine upload --skip-existing --verbose 'dist/*'
113+
114+
# JOB
115+
# Test install from pypi to see if we have any installation bugs.
116+
test-install:
117+
needs: [test-publish]
118+
if: >
119+
startsWith(github.ref, 'refs/tags/') ||
120+
startsWith(github.ref, 'refs/heads/release/')
121+
122+
runs-on: ubuntu-latest
123+
124+
# Use the version from the previous job
125+
env:
126+
VERSION: ${{ needs.test-publish.outputs.version }}
127+
128+
steps:
129+
# Install python (be aware NO checkout action)
130+
- name: Set up Python 3.10
131+
uses: actions/setup-python@v4
132+
with:
133+
python-version: "3.10"
134+
135+
# Check if it installs without errors
136+
- name: Install package
137+
run: |
138+
python -m pip install \
139+
--index-url https://test.pypi.org/simple/ \
140+
--extra-index-url https://pypi.org/simple \
141+
lasso-python=="${VERSION}"
142+
143+
# We run the D3plot import here as it is the most delicate piece of the
144+
# package for importing C-libraries.
145+
- name: Test if the installed package works
146+
run: python -c 'from lasso.dyna import D3plot'
147+
148+
# JOB
149+
# Finally publish the code to pypi
150+
publish:
151+
needs: [test-install]
152+
if: startsWith(github.ref, 'refs/tags/')
153+
runs-on: ubuntu-latest
154+
155+
steps:
156+
- uses: actions/checkout@v3
157+
158+
- name: Set up Python 3.10
159+
uses: actions/setup-python@v4
160+
with:
161+
python-version: "3.10"
162+
163+
- name: Install Task
164+
run: |
165+
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
166+
167+
- name: Load cached venv
168+
id: cached-poetry-dependencies
169+
uses: actions/cache@v3
170+
with:
171+
path: .venv
172+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
173+
174+
- name: Install Dependencies
175+
run: |
176+
python -m pip install --upgrade poetry pip
177+
./bin/task setup
178+
179+
- name: Build packages for release
180+
run: ./bin/task build
181+
182+
# Not required but this saves the distribution files
183+
# with the package upload for debugging purposes.
184+
- name: Save packages as artifacts
185+
uses: actions/upload-artifact@v2
186+
with:
187+
name: dist
188+
path: dist
189+
if-no-files-found: error
190+
191+
- name: Publish distribution to PyPI
192+
env:
193+
TWINE_USERNAME: __token__
194+
TWINE_NON_INTERACTIVE: 1
195+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
196+
run: poetry run twine upload --skip-existing --verbose 'dist/*'
197+
198+
- name: Upload new docs
199+
run: ./bin/task docs:deploy

.gitignore

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# Mac specific files
7+
.DS_Store
8+
9+
# Notepad++ backup file
10+
.bak
11+
12+
# C extensions
13+
*.so
14+
15+
# Distribution / packaging
16+
.Python
17+
./build/
18+
.vscode
19+
build/
20+
develop-eggs/
21+
dist/
22+
downloads/
23+
eggs/
24+
.eggs/
25+
lib/
26+
lib64/
27+
parts/
28+
sdist/
29+
var/
30+
wheels/
31+
*.egg-info/
32+
.installed.cfg
33+
*.egg
34+
MANIFEST
35+
36+
# Unit test / coverage reports
37+
htmlcov/
38+
.tox/
39+
.nox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*.cover
46+
.hypothesis/
47+
.pytest_cache/
48+
49+
# Sphinx documentation
50+
docs/_build/
51+
52+
# Environments
53+
.env
54+
.venv
55+
env/
56+
venv/
57+
ENV/
58+
env.bak/
59+
venv.bak/
60+
61+
# mkdocs documentation
62+
/site
63+
64+
# Compiled Object files
65+
*.slo
66+
*.lo
67+
*.o
68+
*.obj
69+
70+
# Compiled Dynamic libraries
71+
#*.so
72+
*.dylib
73+
*.dll
74+
75+
# Ignore generated changelog
76+
CHANGELOG.md

.markdownlint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# There are different style types for markdown code blocks and strangely
2+
# indentation is the default. We change it here to the more often used 'fenced'
3+
# style denoted by ```
4+
MD046:
5+
style: fenced

0 commit comments

Comments
 (0)