- 
                Notifications
    
You must be signed in to change notification settings  - Fork 183
 
Remove and deprecate unused functions #444
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
Changes from all commits
e617a1b
              d36e1d4
              8364bb5
              fc55221
              44b06bb
              bff1eb8
              9617a07
              b32f5b0
              1737b5b
              d9ffb4f
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: Generate static pickle files | ||
| 
     | 
||
| on: pull_request | ||
| 
     | 
||
| jobs: | ||
| build: | ||
| strategy: | ||
| matrix: | ||
| python_version: [3.6, 3.7, 3.8, 3.9, "pypy3"] | ||
| cloudpickle_version: [1.5.0] | ||
| 
     | 
||
| runs-on: ubuntu-latest | ||
| 
     | 
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| 
     | 
||
| - name: Set up Python ${{ matrix.python_version }} | ||
| uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: ${{ matrix.python_version }} | ||
| 
     | 
||
| - name: Install project and dependencies | ||
| shell: bash | ||
| run: python -m pip install cloudpickle==${{ matrix.cloudpickle_version }} | ||
| 
     | 
||
| - name: Display Python version | ||
| shell: bash | ||
| run: python -c "import sys; print(sys.version)" | ||
| 
     | 
||
| - name: List software environment | ||
| shell: bash | ||
| run: python -m pip list | ||
| 
     | 
||
| - name: Generate pickle files | ||
| shell: bash | ||
| run: | | ||
| cd tests | ||
| rm -rf old_pickles | ||
| python generate_old_pickles.py | ||
| cd ../ | ||
| - name: Upload pickle files | ||
| uses: actions/upload-artifact@v2 | ||
| 
         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. IIUC, Storing pickles as artifacts implies that these pickles will only be available for 90 days (see https://github.com/actions/upload-artifact#retention-period), so we need maintainers to re-run this workflow every 90 days. Are people fine with it? @ogrisel @jrbourbeau  | 
||
| with: | ||
| name: old_pickles | ||
| path: tests/old_pickles | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -17,11 +17,7 @@ | |
| from .generate_old_pickles import PICKLE_DIRECTORY | ||
| 
     | 
||
| 
     | 
||
| def load_obj(filename, check_deprecation_warning='auto'): | ||
| if check_deprecation_warning == 'auto': | ||
| # pickles files generated with cloudpickle_fast.py on old versions of | ||
| # coudpickle with Python < 3.8 use non-deprecated reconstructors. | ||
| check_deprecation_warning = (sys.version_info < (3, 8)) | ||
| def load_obj(filename, check_deprecation_warning=False): | ||
| 
         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. Since   | 
||
| pickle_filepath = PICKLE_DIRECTORY / filename | ||
| if not pickle_filepath.exists(): | ||
| pytest.skip("Could not find {}".format(str(pickle_filepath))) | ||
| 
          
            
          
           | 
    @@ -61,13 +57,13 @@ def test_dynamic_module(): | |
| 
     | 
||
| 
     | 
||
| def test_simple_enum(): | ||
| enum = load_obj("simple_enum.pkl", check_deprecation_warning=False) | ||
| enum = load_obj("simple_enum.pkl") | ||
| assert hasattr(enum, "RED") | ||
| assert enum.RED == 1 | ||
| assert enum.BLUE == 2 | ||
| 
     | 
||
| # test enum tracking feature | ||
| new_enum = load_obj("simple_enum.pkl", check_deprecation_warning=False) | ||
| new_enum = load_obj("simple_enum.pkl") | ||
| assert new_enum is enum | ||
| 
     | 
||
| 
     | 
||
| 
          
            
          
           | 
    ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I think we should not run this at each PR. Let's use a manual trigger instead: https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow