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

CI & co #1

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
19a2033
Clean up setup
noemifrisina Aug 30, 2023
7de933d
Remove azure files
noemifrisina Aug 30, 2023
b9cfdba
Add CI
noemifrisina Aug 30, 2023
2dcb933
Add py3.8
noemifrisina Aug 30, 2023
f389fc0
Try updating version
noemifrisina Aug 30, 2023
294db6d
Temove requirement file
noemifrisina Aug 30, 2023
0bedd59
Add to .gitignore
noemifrisina Aug 30, 2023
f2eba96
Remove setup python
noemifrisina Aug 30, 2023
3822db7
Readd req file
noemifrisina Aug 30, 2023
e323991
Add dependency
noemifrisina Aug 30, 2023
0dbd929
Remove random order in pytest
noemifrisina Aug 30, 2023
f50c812
Add dist
noemifrisina Aug 30, 2023
67c6263
Try pinning setuptools
noemifrisina Aug 30, 2023
57ed422
Restore the versions
noemifrisina Aug 30, 2023
2345d88
Try to make twine happy
noemifrisina Aug 30, 2023
e72b096
Remove requirements file
noemifrisina Aug 30, 2023
42bf117
Add __main__ file
noemifrisina Aug 30, 2023
ee185ff
Tidy up __main__
noemifrisina Aug 30, 2023
2ec4d3d
Add release setp
noemifrisina Aug 30, 2023
bfac190
Don't use req_dev file for lint
noemifrisina Aug 30, 2023
4bbfae4
Fix linting
noemifrisina Aug 30, 2023
96682b0
Fix linting - part 2
noemifrisina Aug 30, 2023
14cc48c
Add tox to pyproject
noemifrisina Aug 30, 2023
918cae3
Remove List step
noemifrisina Aug 30, 2023
2df063c
Add dependabot
noemifrisina Aug 30, 2023
d89eaac
Add linkcheck
noemifrisina Aug 30, 2023
d51580d
Remove unused variable
noemifrisina Aug 31, 2023
35e4c62
Merge branch 'DiamondLightSource:main' into CI-playground
noemifrisina Nov 30, 2023
0186a1c
Use pyproject instead of setup.cfg
noemifrisina Dec 1, 2023
43f26cb
Forgotten file
noemifrisina Dec 1, 2023
846e0dd
Run pre-commit and hopefully fix lint
noemifrisina Dec 6, 2023
b0d714d
Run isort
noemifrisina Dec 6, 2023
11a35e2
Merge branch 'main' into CI-playground
noemifrisina Dec 6, 2023
0580cac
Run isort again
noemifrisina Dec 6, 2023
3ec6ece
Add ignore to flake8
noemifrisina Dec 6, 2023
29dc13d
Use ruff as linter
noemifrisina Dec 6, 2023
84885bd
Run ruff
noemifrisina Dec 6, 2023
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
133 changes: 0 additions & 133 deletions .azure-pipelines/azure-pipelines.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .azure-pipelines/ci.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .azure-pipelines/flake8-validation.py

This file was deleted.

30 changes: 0 additions & 30 deletions .azure-pipelines/syntax-validation.py

This file was deleted.

6 changes: 3 additions & 3 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ current_version = 0.7.2
commit = True
tag = True

[bumpversion:file:setup.cfg]
search = version = {current_version}
replace = version = {new_version}
[bumpversion:file:pyproject.toml]
search = version = "{current_version}"
replace = version = "{new_version}"

[bumpversion:file:src/nexgen/__init__.py]
search = __version__ = "{current_version}"
Expand Down
57 changes: 57 additions & 0 deletions .github/actions/install_requirements/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Install requirements
description: Run pip install with requirements and upload resulting requirements
inputs:
requirements_file:
description: Name of requirements file to use and upload
required: true
install_options:
description: Parameters to pass to pip install
required: true
python_version:
description: Python version to install
default: "3.x"

runs:
using: composite

steps:
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}

- name: Pip install
run: |
touch ${{ inputs.requirements_file }}
# -c uses requirements.txt as constraints, see 'Validate requirements file'
pip install -c ${{ inputs.requirements_file }} ${{ inputs.install_options }}
shell: bash

- name: Create lockfile
run: |
mkdir -p lockfiles
pip freeze --exclude-editable > lockfiles/${{ inputs.requirements_file }}
# delete the self referencing line and make sure it isn't blank
sed -i '/file:/d' lockfiles/${{ inputs.requirements_file }}
shell: bash

- name: Upload lockfiles
uses: actions/upload-artifact@v3
with:
name: lockfiles
path: lockfiles

# This eliminates the class of problems where the requirements being given no
# longer match what the packages themselves dictate. E.g. In the rare instance
# where I install some-package which used to depend on vulnerable-dependency
# but now uses good-dependency (despite being nominally the same version)
# pip will install both if given a requirements file with -r
- name: If requirements file exists, check it matches pip installed packages
run: |
if [ -s ${{ inputs.requirements_file }} ]; then
if ! diff -u ${{ inputs.requirements_file }} lockfiles/${{ inputs.requirements_file }}; then
echo "Error: ${{ inputs.requirements_file }} need the above changes to be exhaustive"
exit 1
fi
fi
shell: bash
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
Loading