Skip to content

Commit

Permalink
Novcr (#494)
Browse files Browse the repository at this point in the history
* fix editable nix

nix-community/poetry2nix#425

* delete cassettes

They've been more trouble than they're worth.
Most of the point of this library is to be an API wrapper
If my tests fail on live runs I want to know

* handle off days

Get changed series returns a 409 (why?!) when it's run on a day with no
updates

* remove pyvcr

You're an API wrapper, test the API

* remove dependency on pytest-recording
  • Loading branch information
ianepreston authored Jul 21, 2024
1 parent db6416e commit c924375
Show file tree
Hide file tree
Showing 60 changed files with 15 additions and 702,153 deletions.
3 changes: 3 additions & 0 deletions activate_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /usr/bin/env bash
export PROJECT_DIR=$(dirname "$(realpath -s "${BASH_SOURCE[0]}")")
nix develop --impure $PROJECT_DIR -c zsh
7 changes: 6 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
makePoetryEnvPyVer = pythonPackage:
mkPoetryEnv {
projectDir = self;
editablePackageSources = { my-app = ./src; };
editablePackageSources = {
stats_can = if builtins.getEnv "PROJECT_DIR" == "" then
./src
else
"${builtins.getEnv "PROJECT_DIR"}/src";
};
python = pythonPackage;
preferWheels = true;
groups = [ "dev" ];
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ xdoctest = ">=1.1"
sphinx-autodoc-typehints = ">=1.23"
sphinx_rtd_theme = ">=1.2"
safety = ">=2.3"
pytest-recording = "^0.13.1"


[tool.coverage.paths]
Expand Down
8 changes: 5 additions & 3 deletions src/stats_can/scwds.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

from stats_can.helpers import check_status, chunk_vectors, parse_tables


SC_URL = "https://www150.statcan.gc.ca/t1/wds/rest/"


Expand All @@ -45,8 +44,11 @@ def get_changed_series_list():
"""
url = SC_URL + "getChangedSeriesList"
result = requests.get(url)
result = check_status(result)
return result["object"]
try:
result = check_status(result)
return result["object"]
except requests.exceptions.HTTPError:
return list()


def get_changed_cube_list(date=None):
Expand Down
1,501 changes: 0 additions & 1,501 deletions tests/cassettes/test_class_table_list_download_delete.yaml

This file was deleted.

91 changes: 0 additions & 91 deletions tests/cassettes/test_class_tables_for_vectors.yaml

This file was deleted.

Loading

0 comments on commit c924375

Please sign in to comment.