-
Notifications
You must be signed in to change notification settings - Fork 0
Pip package for lablink-client
#5
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
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
0da3bb2
make pip package
eberrigan 21128ca
Rename project urls
roomrys d6cef2f
Add more keywords
roomrys 1bb89b0
Add pytest and black to dev extras
roomrys 343a8ad
Specifiy location of source code
roomrys 98e15fd
Test the imports
roomrys 68d1f8d
Lint
roomrys ad291d8
Reorganize pyproject
roomrys 9f36b5f
Remove unneccessary requirements
roomrys 8aa7ca8
Merge branch 'main' of https://github.com/talmolab/cosyne_vm into eli…
roomrys 9063357
Install dev extras via environment.yml
roomrys 407fd17
make imports backwards compatible
eberrigan 2a6b079
add ci for pip package tests but not upload
eberrigan 3ddd310
update andrews email
eberrigan 56fb3fe
ci was in wrong folder
eberrigan 95db597
import from tutorial_vm again
eberrigan 0737499
add setup for google cloud credentials to ci
eberrigan cd85066
fix indentation
eberrigan 57282bc
add manual publish action
eberrigan b3caf03
rename package to lablink-client
eberrigan 0e9da40
rename package directory to lablink_client
eberrigan 97937a5
rename package directory to lablink_client
eberrigan 311c63a
pip package source code is now in lablink_client folder
eberrigan a990f77
use workload identity provider instead of service account
eberrigan 9e8fa84
authenticate using auth
eberrigan 596b681
add quotes
eberrigan 2880ab8
remove authentication step
eberrigan 71c456f
initialize logging with None
eberrigan 0c22881
add multiple jobs
eberrigan 44e0e23
remove authentication
eberrigan ce9a6d3
add separate job for tests
eberrigan 8c26809
update env
eberrigan 7e767ea
list files
eberrigan 98fc5de
fix dev dependencies
eberrigan edaaee9
make publish pip workflow
eberrigan b8005b7
change where to find package
eberrigan bb9210d
remove pythonpath manipulation
eberrigan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Build and Test | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
build: | ||
name: Build lablink-client | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --editable .[dev] | ||
|
||
- name: Build package | ||
run: | | ||
python -m build | ||
twine check dist/* | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: lablink-client-dist | ||
path: dist/ | ||
retention-days: 1 | ||
|
||
tests: | ||
name: Test lablink-client | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
Comment on lines
+47
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we do need the tests folder, but having all the code checked-out can lead to false positive import tests (see b8005). Maybe there is a way to just move the tests folder and change that to our working directory? |
||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: lablink-client-dist | ||
path: dist/ | ||
|
||
- name: List files | ||
run: | | ||
ls dist/ | ||
|
||
- name: Install package from artifact | ||
run: | | ||
WHL=$(ls dist/*.whl) | ||
pip install "$WHL[dev]" | ||
|
||
- name: Print installed packages | ||
run: | | ||
pip list | ||
|
||
- name: Run tests | ||
run: | | ||
pytest tests/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Publish on Release | ||
# This workflow will only work if an artifact named "lablink-client-dist" is uploaded to the repository | ||
# Run this workflow after testing using the "build-and-test-pip.yml" workflow | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Download Package Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: lablink-client-dist # Name of the artifact to download | ||
path: package/ # Download the artifact to this path | ||
|
||
- name: Verify Artifact Contents | ||
run: | | ||
ls package/ | ||
|
||
- name: Publish package | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.TUTORIAL_PYPI_API_TOKEN }} | ||
run: | | ||
twine upload package/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
[project] | ||
name = "lablink-client" | ||
version = "0.0.1a0" | ||
authors = [ | ||
{ name = "Liezl Maree", email = "[email protected]" }, | ||
{ name = "Andrew Park", email = "[email protected]" }, | ||
{ name = "Elizabeth Berrigan", email = "[email protected]" }, | ||
] | ||
description = "Scripts for VM instances of tutorial platform." | ||
readme = "README.md" | ||
license = { file = "LICENSE" } | ||
requires-python = ">=3.7" | ||
dependencies = [ | ||
"google-cloud-logging", | ||
"google-cloud-pubsub", | ||
"google-cloud-spanner==3.42.0", | ||
"psutil", | ||
] | ||
keywords = [ | ||
"tutorial", | ||
"vm", | ||
"gcp", | ||
"google-cloud", | ||
"spanner", | ||
"pubsub", | ||
"logging", | ||
] | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"Operating System :: OS Independent", | ||
"Development Status :: 3 - Alpha", | ||
] | ||
|
||
[project.optional-dependencies] | ||
dev = ["toml", "twine", "build", "pytest", "black"] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/talmolab/tutorial_vm" | ||
Issues = "https://github.com/talmolab/tutorial_vm/issues" | ||
|
||
[build-system] | ||
requires = ["setuptools", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["."] | ||
include = ["lablink_client*"] | ||
|
||
[tool.pytest.ini_options] | ||
pythonpath = ["."] |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"""Module that tests the imports of the package.""" | ||
|
||
|
||
def test_import(): | ||
import lablink_client | ||
|
||
from lablink_client import crd_connect | ||
from lablink_client import database | ||
from lablink_client import logging_utils | ||
from lablink_client import subscribe_instance | ||
from lablink_client import update_inuse_status |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.