Skip to content

Commit

Permalink
Merge pull request #1010 from UC-Davis-molecular-computing/990-upgrad…
Browse files Browse the repository at this point in the history
…e-to-dart-3

Fixes #990 - Upgrade to Dart 3
  • Loading branch information
beanbeanjuice authored Dec 8, 2024
2 parents 8cf86d8 + 274418f commit b45ed4b
Show file tree
Hide file tree
Showing 11 changed files with 202 additions and 174 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
- name: Setup Dart SDK Step 4
run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
- name: Setup Dart SDK Step 5
run: wget -O /tmp/dart_2.19.6-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/2.19.6/linux_packages/dart_2.19.6-1_amd64.deb
run: wget -O /tmp/dart_3.5.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/3.5.4/linux_packages/dart_3.5.4-1_amd64.deb
- name: Setup Dart SDK Step 6
run: sudo apt install /tmp/dart_2.19.6-1_amd64.deb
- uses: actions/checkout@v3
run: sudo apt install /tmp/dart_3.5.4-1_amd64.deb
- uses: actions/checkout@v4
- name: Install dependencies
run: PATH="$PATH:/usr/lib/dart/bin" dart pub get
- name: Run tests
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dart_formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
- name: Setup Dart SDK Step 4
run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
- name: Setup Dart SDK Step 5
run: wget -O /tmp/dart_2.19.6-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/2.19.6/linux_packages/dart_2.19.6-1_amd64.deb
run: wget -O /tmp/dart_3.5.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/3.5.4/linux_packages/dart_3.5.4-1_amd64.deb
- name: Setup Dart SDK Step 6
run: sudo apt install /tmp/dart_2.19.6-1_amd64.deb
- uses: actions/checkout@v3
run: sudo apt install /tmp/dart_3.5.4-1_amd64.deb
- uses: actions/checkout@v4
- name: Install dependencies
run: PATH="$PATH:/usr/lib/dart/bin" dart pub get
- name: Verify formatting
run: dart format -l 110 --output=none --set-exit-if-changed .
run: PATH="$PATH:/usr/lib/dart/bin" dart format -l 110 --output=none --set-exit-if-changed .

fail_if_pull_request_is_draft:
if: github.event.pull_request.draft == true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
- name: Setup Dart SDK Step 4
run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
- name: Setup Dart SDK Step 5
run: wget -O /tmp/dart_2.19.6-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/2.19.6/linux_packages/dart_2.19.6-1_amd64.deb
run: wget -O /tmp/dart_3.5.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/3.5.4/linux_packages/dart_3.5.4-1_amd64.deb
- name: Setup Dart SDK Step 6
run: sudo apt install /tmp/dart_2.19.6-1_amd64.deb
run: sudo apt install /tmp/dart_3.5.4-1_amd64.deb

- name: Install dependencies
run: PATH="$PATH:/usr/lib/dart/bin" dart pub get
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ jobs:
- name: Setup Dart SDK Step 4
run: sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
- name: Setup Dart SDK Step 5
run: wget -O /tmp/dart_2.19.6-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/2.19.6/linux_packages/dart_2.19.6-1_amd64.deb
run: wget -O /tmp/dart_3.5.4-1_amd64.deb https://storage.googleapis.com/dart-archive/channels/stable/release/3.5.4/linux_packages/dart_3.5.4-1_amd64.deb
- name: Setup Dart SDK Step 6
run: sudo apt install /tmp/dart_2.19.6-1_amd64.deb
run: sudo apt install /tmp/dart_3.5.4-1_amd64.deb
- name: Install dependencies
run: PATH="$PATH:/usr/lib/dart/bin" pub get
run: PATH="$PATH:/usr/lib/dart/bin" dart pub get

- name: Install webdev
run: PATH="$PATH:/usr/lib/dart/bin" pub global activate webdev
run: PATH="$PATH:/usr/lib/dart/bin" dart pub global activate webdev


- name: Build into gh-pages repo
Expand Down
24 changes: 13 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,23 +241,23 @@ git checkout dev

### Installing Dart

This project requires using Dart version **2.19.6**, not the latest version, which is 3.x. Click on a dropdown below for installation instructions for your operating system.
This project requires using Dart version **3.5.4**, not the latest version. Click on a dropdown below for installation instructions for your operating system.

<!--TODO: Find a way to use code blocks with syntax highlighting inside <details>-->

<details><summary><strong>Windows</strong></summary>
First, install <a href="https://chocolatey.org/install">Chocolatey</a> if you haven't already. If <code>choco help</code> shows a help menu for using Chocolatey, then you've set it up correctly.

Then, open a shell (cmd/Powershell) with Administrative privileges (go to Start type `cmd`, right-click on "Command Prompt", or type Powershell and right-click on "Powershell"; in both cases pick "Run as administrator") and install Dart 2.19.6:
Then, open a shell (cmd/Powershell) with Administrative privileges (go to Start type `cmd`, right-click on "Command Prompt", or type Powershell and right-click on "Powershell"; in both cases pick "Run as administrator") and install Dart 3.5.4:

<pre>
choco install dart-sdk --version 2.19.6
choco install dart-sdk --version 3.5.4
</pre>

To stop Chocolatey from automatically updating Dart to the latest version, pin it:

<pre>
choco pin --name="'dart-sdk'" --version="'2.19.6'"
choco pin --name="'dart-sdk'" --version="'3.5.4'"
</pre>

</details>
Expand All @@ -267,16 +267,16 @@ First, install <a href="https://brew.sh/">Homebrew</a> if you haven't already. I

It may help to run `brew tap dart-lang/dart` first.

Then, install Dart 2.19.6:
Then, install Dart 3.5.4:

<pre>
brew install dart@2.19.6
brew install dart@3.5.4
</pre>

To stop Homebrew from automatically updating Dart to the latest version, pin it:

<pre>
brew pin dart@2.19.6
brew pin dart@3.5.4
</pre>

If running `dart` in a terminal now does not work, you may need to follow <a href="https://docs.brew.sh/FAQ#my-mac-apps-dont-find-homebrew-utilities">these instructions</a>.
Expand All @@ -292,17 +292,17 @@ wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo gpg --dea
echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list
</pre>

Then, install Dart 2.19.6:
Then, install Dart 3.5.4:

<pre>
sudo apt-get update
sudo apt-get install dart=2.19.6
sudo apt-get install dart=3.5.4
</pre>

To stop apt from automatically updating Dart to the latest version, hold it:

<pre>
sudo apt-mark hold dart=2.19.6
sudo apt-mark hold dart=3.5.4
</pre>

</details>
Expand All @@ -323,6 +323,8 @@ Try running the unit tests like this:
dart run build_runner test
```

If the above command fails, it should be run as sudo or an administrator.

It should report something like this after running the tests:

```
Expand All @@ -347,7 +349,7 @@ Built test:test.
`webdev` is used to run a local server for running scadnano in your browser for testing. Install it with:

```
pub global activate webdev
dart pub global activate webdev
```

Note that often a message like this appears:
Expand Down
2 changes: 0 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ linter:
rules:
- cancel_subscriptions
- hash_and_equals
- iterable_contains_unrelated_type
- list_remove_unrelated_type
- test_types_in_equals
- unrelated_type_equality_checks
- valid_regexps
2 changes: 1 addition & 1 deletion lib/src/middleware/export_cadnano_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ have different parity of row number: respectively ${helix_from_dct['row']} and $
} else if (!forward_from && !forward_to) {
helix_from_dct[strand_type][start_from]
.setRange(2, helix_from_dct[strand_type][start_from].length, [helix_to, end_to - 1]);
helix_to_dct[strand_type][start_to].setRange(0, 2, [helix_from, end_from - 1]);
helix_to_dct[strand_type][end_to - 1].setRange(0, 2, [helix_from, start_from]);
if (helix_from_dct['row'] % 2 != helix_to_dct['row'] % 2) {
throw new IllegalCadnanoDesignError('''\
Paranemic crossovers are only allowed between helices that have the same parity of
Expand Down
Loading

0 comments on commit b45ed4b

Please sign in to comment.