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

First development version v3.0.0.dev0 #6

Merged
merged 15 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 0 additions & 8 deletions .bumpversion.cfg

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/check_mode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This workflow ensures that debug modes are turned off in all the files

name: mode_check

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
# Build and test
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: GUI debug mode - ensure turned off
run: |
grep 'self.rundebug = False' src/rimsschemedrawer/gui.py
117 changes: 0 additions & 117 deletions .github/workflows/create_release.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/package_testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
MAIN_PYTHON_VERSION: "3.12"

jobs:
# Build and test
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install the latest version of rye
uses: eifinger/setup-rye@v1
- name: Sync Rye
run: |
rye pin ${{ matrix.python-version }}
rye sync
- name: Run Tests for python interface
run: rye run test
- name: Run Lint on one python
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION }}
run: rye lint
- name: Run Pytest with coverage
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION }}
run: |
rye run test_cov
- name: Upload coverage reports to Codecov
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION && github.repository_owner == 'galactic-forensics' }}
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
13 changes: 11 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Various files
# Various data
*.xml
*.iml
tkinter_version/RIMSSchemeDrawer_RT.command
Expand All @@ -20,4 +20,13 @@ target/*

# ST3
*.sublime-project
*.sublime-workspace
*.sublime-workspace

# testing
.hypothesis

#PyCharm
.idea

# coverage
.coverage
1 change: 0 additions & 1 deletion AUTHORS

This file was deleted.

129 changes: 60 additions & 69 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,87 @@
# Installation

## Install
Use the provided installers for OSX (10.14 and upwards) or
Windows 10. Those can be found in releases. This software also
runs on Linux, however, you should compile it yourself for best
results.
The following instructions are for installation of the GUI for release version `2.1.4`.
Instructions for installation from source are given for the development version.

## GUI

## Compilation: TL;DR
To install the GUI,
it is recommended that you use [`pipx`](https://github.com/pypa/pipx).
This will create a new virtual environment
in which the `rimsschemedrawer` is executed.

This package should work with python 3.7+.
Follow the instructions at the given link to install `pipx`.
Then install the `rimsschemedrawer` by typing:

python -m venv venv
source venv/bin/activate
```bash
pipx install rimsschemedrawer[gui]
```

or via conda:
You can now run the drawer by simply running the installed executable:

conda create -n schemedrawer python=3.8
conda activate schemedrawer
```bash
rimsschemedrawer
```

Install dependencies:
## Development version (`v3`)

pip install -r requirements.txt
This version is currently under development.
To install development versions and pre-releases from `pypi`,
please see the main [README](README.md).

Freeze and create installer (note that you must have `fbs pro` for this to run smootly)
## From Source

fbs freeze
fbs installer
To install the `rimsschemedrawer` from source
and work with it,
we recommend that you have [`rye`](https://rye-up.com/) installed.

Look at the output, it will tell you where the files are.
Clone the repository and go into the folder:

```bash
git clone https://github.com/RIMS-Code/RIMSSchemeDrawer.git
cd RIMSSchemeDrawer
```

## Compilation: Detailed Instructions
If you have `rye` installed,
simply run:

This software uses fbs pro to build the PyQt5, python application.
[https://build-system.fman.io/](https://build-system.fman.io/)
Please check out the fbs tutorial for details.
```bash
rye sync --all-features
```

### Virtual environment creation
Using `pip`
ideally inside a virtual environment
run:

The best results are achieved if you compile from a virtual environment. You must have python3.5 or python3.6 installed. If you use standard python, go ahead and type:
```bash
pip install .[gui]
```

python -m venv venv
If you do not want the GUI capability,
leave the `--all-features` (`rye`)
or the `[gui]` part (`pip`) out.

to create a virtual environment. It can then be activated with
If you have the GUI,
you can now run:

source venv/bin/activate
```bash
rye run rimsschemedrawer
```

or on Windows via:

call venv\Scripts\activate
or

With conda create a virtual environment in python3.6 by typing:
```bash
rimsschemedrawer
```

conda create -n schemedrawer python=3.6
## Contribute

This will ensure that you have a python3.6 environment. The `-n` option furthermore lets you specify a name for the virtual environment, here the name is `schemedrawer`. Activating the virtual environment can be done via:

conda activate schemedrawer

### Installation of requirements

Several python packages must be installed in python virtual environment. This repository contains a requirement file, which lets you easily set up the requirements by running:

pip install -r requirements.txt

Note: Please see the [fbs tutorial](https://github.com/mherrmann/fbs-tutorial) for further requirements if you want to create installers of the program as well.

### Freezing the software and creating installers

If you have fbs pro installed, you should be able to run the software now if you are in the project folder by running:

fbs run

To freeze the program, i.e., create an executable run:

fbs freeze

An installer, the type of which depends on your operating system, can be created after freezing by typing:

fbs installer

Such installers can also be found in the released versions.

If you want to clean up your compiled versions, go ahead and type

fbs clean

### Troubleshooting

* On Windows, freezing the application, even if all the dependencies mentioned on the fbs tutorial site are installed, can throw an error that not all libraries are installed. It gives you a link to download the windows developer kit or something like that. After doing that and installing it, you should be good to go.

* I have seen PyInstaller errors that look something like this: `subprocess.CalledProcessError: Command '['pyinstaller', some more characters]` These errors can indicate a package conflict. I had conflicts especially with the `enum34` package. Simply uninstall it with: `pip uninstall enum34` usually solves the problem and should not give you any trouble since you are in a virtual environment.
If you use `rye` and follow the instructions above
for installation from source,
you will have all required dependencies for development installed.

The following additional commands can be useful:

- `rye format`: Format the code with [`ruff`](https://docs.astral.sh/ruff/formatter/)
- `rye lint`: Lint the code with [`ruff`](https://docs.astral.sh/ruff/formatter/)
- `rye run test`: Test the code with [`pytest`](https://docs.pytest.org/)
Loading