File tree Expand file tree Collapse file tree 8 files changed +129
-0
lines changed Expand file tree Collapse file tree 8 files changed +129
-0
lines changed Original file line number Diff line number Diff line change 7272        run : | 
7373          pytest pins -m 'fs_rsc and not skip_on_github' 
7474
75+    check-cross-compatibility :
76+     name : " Check cross lib compatibility" 
77+     runs-on : ubuntu-latest 
78+     steps :
79+     - uses : actions/checkout@v2 
80+ 
81+     - name : Install libcurl on Linux 
82+       run : sudo apt-get update -y && sudo apt-get install -y libcurl4-openssl-dev 
83+ 
84+     #  r ---
85+ 
86+     - uses : r-lib/actions/setup-r@v2 
87+       with :
88+         use-public-rspm : true 
89+ 
90+     - name : Install R dependencies 
91+       run : " install.packages('pins')" 
92+       shell : Rscript {0} 
93+ 
94+     #  python ---
95+ 
96+     - uses : actions/setup-python@v2 
97+       with :
98+         python-version : 3.8 
99+     - name : Install py dependencies 
100+       run : | 
101+         python -m pip install --upgrade pip 
102+         python -m pip install -r requirements/dev.txt 
103+         python -m pip install -e . 
104+ 
105+      #  write and test ---
106+ 
107+     - name : Run script/ci-compat-check 
108+       run : make ci-compat-check 
109+ 
75110  build-docs :
76111    name : " Build Docs" 
77112    runs-on : ubuntu-latest 
Original file line number Diff line number Diff line change @@ -36,3 +36,7 @@ requirements/dev.txt: setup.cfg
3636
3737binder/requirements.txt : requirements/dev.txt
3838	cp $<  $@ 
39+ 
40+ ci-compat-check :
41+ 	#  TODO: mark as dummy
42+ 	$(MAKE )  -C script/$@ 
Original file line number Diff line number Diff line change 1+ tmp 
Original file line number Diff line number Diff line change 1+ BOARD_BASE_DIR =tmp
2+ BOARD_PY =$(BOARD_BASE_DIR ) /board-py
3+ BOARD_R =$(BOARD_BASE_DIR ) /board-r
4+ 
5+ all : validate
6+ 
7+ clean :
8+ 	rm -r $(BOARD_PY )  $(BOARD_R ) 
9+ 
10+ validate : $(BOARD_PY )  $(BOARD_R ) 
11+ 	@echo " \n\nRUNNING R PINS ---\n" 
12+ 	Rscript validate_py_to_r.R $(BOARD_PY )  $(BOARD_R ) 
13+ 	@echo " \n\nRUNNING PYTHON PINS ---\n" 
14+ 	python validate_r_to_py.py $(BOARD_PY )  $(BOARD_R ) 
15+ 
16+ $(BOARD_PY )  : dump_py_pins.py
17+ 	python dump_py_pins.py $@ 
18+ 
19+ $(BOARD_R )  : dump_r_pins.R
20+ 	Rscript dump_r_pins.R $@ 
Original file line number Diff line number Diff line change 1+ import  sys 
2+ 
3+ from  pins .data  import  mtcars 
4+ from  pins  import  board_folder 
5+ 
6+ if  len (sys .argv ) <  2 :
7+     raise  ValueError ("must pass board location as command-line argument" )
8+ else :
9+     BOARD_PATH  =  sys .argv [1 ]
10+ 
11+ board  =  board_folder (BOARD_PATH )
12+ board .pin_write (mtcars , "mtcars" , type = "csv" )
Original file line number Diff line number Diff line change 1+ library(pins )
2+ args  <-  commandArgs(trailingOnly = TRUE )
3+ 
4+ board  <-  board_folder(args [1 ])
5+ board  %> % pin_write(mtcars , " mtcars"  , type = " csv"  )
Original file line number Diff line number Diff line change 1+ library(pins )
2+ 
3+ args  <-  commandArgs(trailingOnly = TRUE )
4+ 
5+ 
6+ #  create board ----
7+ 
8+ board_py  <-  board_folder(args [1 ])
9+ board_r  <-  board_folder(args [2 ])
10+ 
11+ 
12+ #  check pins ----
13+ 
14+ cat(" Checking mtcars pin\n "  )
15+ 
16+ res_mtcars  <-  board_py  %> % pin_read(" mtcars"  )
17+ stopifnot(all.equal(res_mtcars , datasets :: mtcars , check.attributes = FALSE ))
18+ 
19+ meta_mtcars_py  <-  board_py  %> % pin_meta(" mtcars"  )
20+ cat(" \n Python meta:\n\n "  )
21+ print(meta_mtcars_py )
22+ 
23+ meta_mtcars_r  <-  board_r  %> % pin_meta(" mtcars"  )
24+ cat(" \n R meta:\n\n "  )
25+ print(meta_mtcars_r )
Original file line number Diff line number Diff line change 1+ import  sys 
2+ 
3+ from  pins  import  board_folder 
4+ from  pins  import  data 
5+ 
6+ path_py , path_r  =  sys .argv [1 ], sys .argv [2 ]
7+ 
8+ # create board ---- 
9+ 
10+ board_py  =  board_folder (path_py )
11+ board_r  =  board_folder (path_r )
12+ 
13+ 
14+ # check pins ---- 
15+ 
16+ print ("Checking mtcars pin" )
17+ 
18+ res_mtcars  =  board_r .pin_read ("mtcars" )
19+ assert  res_mtcars .equals (data .mtcars )
20+ 
21+ meta_mtcars_py  =  board_py .pin_meta ("mtcars" )
22+ print ("\n Python meta:\n " )
23+ print (meta_mtcars_py )
24+ 
25+ meta_mtcars_r  =  board_r .pin_meta ("mtcars" )
26+ print ("\n R meta:\n " )
27+ print (meta_mtcars_r )
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments